On Sun, Mar 25, 2012 at 9:30 AM, Aryeh Leib Taurog wrote:
>
> On Mar 23, 3:56 pm, Javier Guerra Giraldez wrote:
> > On Fri, Mar 23, 2012 at 4:37 AM, Aryeh Leib Taurog
> > wrote:
> >
> > > My understanding is that one usually
> > > wants an index on the *referenced* field, not the *referencing*
>
On Mar 23, 3:56 pm, Javier Guerra Giraldez wrote:
> On Fri, Mar 23, 2012 at 4:37 AM, Aryeh Leib Taurog wrote:
>
> > My understanding is that one usually
> > wants an index on the *referenced* field, not the *referencing*
> > field.
>
> it's for the back-reference link. so that you can do
> group
On Fri, Mar 23, 2012 at 4:37 AM, Aryeh Leib Taurog wrote:
> My understanding is that one usually
> wants an index on the *referenced* field, not the *referencing*
> field.
it's for the back-reference link. so that you can do
group.item_set.all() and get all the items that share a group.
yes, th
With the following models:
class Group(models.Model):
group_name = models.CharField(max_length=10, primary_key=True)
class Item(models.Model):
item_name = models.CharField(max_length=10)
group = models.ForeignKey(Group)
class Meta:
unique_together = [('item_name','group')]
4 matches
Mail list logo