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 = AlterEgo.objects.filter(user__name__exact='Ryan')

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 understanding this part of the API is greatly appreciated!

Thanks,
Ryan


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to