now seed_db created notifications also
authorNishanth Amuluru <nishanth@fossee.in>
Fri, 07 Jan 2011 12:42:22 +0530
changeset 279 d84a3781b979
parent 278 60f363b6e9d8
child 280 a3a44b21845d
now seed_db created notifications also
profile/management/commands/seed_db.py
profile/models.pyc
--- a/profile/management/commands/seed_db.py	Fri Jan 07 12:38:55 2011 +0530
+++ b/profile/management/commands/seed_db.py	Fri Jan 07 12:42:22 2011 +0530
@@ -4,13 +4,13 @@
 
 from django.contrib.auth.models import User
 
-from pytask.profile.models import Profile
+from pytask.profile.models import Profile, Notification
 
 def seed_db():
     """ a method to seed the database with random data """
     
     
-    for i in range(1,21):
+    for i in range(21,1,-1):
         
         username = 'user'+str(i)
         email = username+'@example.com'
@@ -38,6 +38,17 @@
             new_profile.rights = "CR"
         new_profile.save()
 
+    new_user.is_superuser = True
+    new_user.is_staff = True
+    new_user.save()
+
+    for i in range(10):
+        Notification(sent_to=new_user, sent_date=datetime.now(), 
+                     subject="A subject here for"+str(i),
+                     message="A message with mess"+str(i)+" html inside.\
+                     <br /><b>a bold text</b>"
+                    ).save()
+
 class Command(NoArgsCommand):
     
     def handle_noargs(self, **options):
Binary file profile/models.pyc has changed