diff options
author | Nishanth Amuluru | 2011-01-07 12:42:22 +0530 |
---|---|---|
committer | Nishanth Amuluru | 2011-01-07 12:42:22 +0530 |
commit | 6e1de08b2ebabccf55a086336df0418f68e7664b (patch) | |
tree | d8c39b4cadabb8bee1a2565a35bf296d24559ce8 | |
parent | 5db65241211a9c0f56561f446c21c70662c59d95 (diff) | |
download | pytask-6e1de08b2ebabccf55a086336df0418f68e7664b.tar.gz pytask-6e1de08b2ebabccf55a086336df0418f68e7664b.tar.bz2 pytask-6e1de08b2ebabccf55a086336df0418f68e7664b.zip |
now seed_db created notifications also
-rw-r--r-- | profile/management/commands/seed_db.py | 15 | ||||
-rw-r--r-- | profile/models.pyc | bin | 3783 -> 3714 bytes |
2 files changed, 13 insertions, 2 deletions
diff --git a/profile/management/commands/seed_db.py b/profile/management/commands/seed_db.py index b8ceabe..0ba4965 100644 --- a/profile/management/commands/seed_db.py +++ b/profile/management/commands/seed_db.py @@ -4,13 +4,13 @@ from django.core.management.base import NoArgsCommand 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 @@ def seed_db(): 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): diff --git a/profile/models.pyc b/profile/models.pyc Binary files differindex 30b07ad..886a5ff 100644 --- a/profile/models.pyc +++ b/profile/models.pyc |