From 6e1de08b2ebabccf55a086336df0418f68e7664b Mon Sep 17 00:00:00 2001 From: Nishanth Amuluru Date: Fri, 7 Jan 2011 12:42:22 +0530 Subject: now seed_db created notifications also --- profile/management/commands/seed_db.py | 15 +++++++++++++-- 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.\ +
a bold text" + ).save() + class Command(NoArgsCommand): def handle_noargs(self, **options): diff --git a/profile/models.pyc b/profile/models.pyc index 30b07ad..886a5ff 100644 Binary files a/profile/models.pyc and b/profile/models.pyc differ -- cgit