Re: How to create new User with Profile in elegant way

2009-03-10 Thread Ross Dakin
On Mar 9, 1:06 am, myst3rious wrote: > > If you're setting all these things in the User object, then reverse the > > logic slightly: > > >         new_user = User.objects.create(username=username, > >             email=email, > >             is_active=True, > >            

Re: How to create new User with Profile in elegant way

2009-03-09 Thread Malcolm Tredinnick
On Mon, 2009-03-09 at 01:06 -0700, myst3rious wrote: > > > If you're setting all these things in the User object, then reverse the > > logic slightly: > > > > new_user = User.objects.create(username=username, > > email=email, > > is_active=True, > >

Re: How to create new User with Profile in elegant way

2009-03-09 Thread myst3rious
> If you're setting all these things in the User object, then reverse the > logic slightly: > >         new_user = User.objects.create(username=username, >             email=email, >             is_active=True, >             first_name=firstname, >             last_name=lastname) >        

Re: How to create new User with Profile in elegant way

2009-03-09 Thread Malcolm Tredinnick
On Sun, 2009-03-08 at 23:30 -0700, myst3rious wrote: > Hi, > Working on a Django app, which requires profile for each subscribing > user, I created a Profile model: > class Profile(models.model): > user = models.ForeignKey(User, unique=True) > middlename = models.CharField(max_length=32,

How to create new User with Profile in elegant way

2009-03-09 Thread myst3rious
Hi, Working on a Django app, which requires profile for each subscribing user, I created a Profile model: class Profile(models.model): user = models.ForeignKey(User, unique=True) middlename = models.CharField(max_length=32, blank=True) gender = models.CharField(max_length=1,