The tutorial explains how to get objects based on field values, but I
need to get a subset of the objects in a OneToMany relationship based
on one of their values. Here's an example:
BRANCH_KINDS = ((0, 'Main'), (1, 'Auxiliary'), (2, 'Dead'),)
class Trunk(meta.Model):
name = meta.CharField(max_length=10)
class Branch(meta.Model):
trunk = meta.ForeignKey(Trunk)
kind = meta.IntegerField(choices=BRANCH_KINDS)
Say I have a Trunk object and want to get all of its Auxiliary
branches. How the heck do I do that?
Todd
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---