Re: Help understanding the DB API

2007-10-25 Thread Ryan K
Perfect! Thanks. On Oct 25, 2:20 pm, "Marty Alchin" <[EMAIL PROTECTED]> wrote: > On 10/25/07, Ryan K <[EMAIL PROTECTED]> wrote: > > > Why can't I change the User's name like so: > > > results[0].user.name = 'Brian' > > results[0].user.save() > > > ? > > > I instead have to assign it first: > > >

Re: Help understanding the DB API

2007-10-25 Thread Marty Alchin
On 10/25/07, Ryan K <[EMAIL PROTECTED]> wrote: > Why can't I change the User's name like so: > > results[0].user.name = 'Brian' > results[0].user.save() > > ? > > I instead have to assign it first: > > found_user = results[0].user > found_user.name = 'Brian' > found_user.save() > > Any help unders

Help understanding the DB API

2007-10-25 Thread Ryan K
For example, I have to basic models: class User(models.Model): name = models.CharField(max_length=30) class AlterEgo(models.Model): nickname = models.CharField(max_length=30) user = models.ForeignKey(User) I do a lookup for a User named 'Ryan' and one object is found. results

Help understanding the DB API

2007-10-25 Thread Ryan K
For example, I have to basic models: class User(models.Model): name = models.CharField(max_length=30) class AlterEgo(models.Model): nickname = models.CharField(max_length=30) user = models.ForeignKey(User) I do a lookup for a User named 'Ryan' and one object is found. results