Thank You! That was the correct syntax :)

For anyone else with the same problem, you can also utilise
"related_name" to provide syntactically pleasing access to your
objects, such as:

lightbox.photographs.all() - to retrieve Photograph objects
lightbox.items.all() - to retrieve Item objects
photgraphy.items.all()
photgraphy.lightboxes.all()

class Photograph(ImageModel):
    pass

class Lightbox(models.Model):
    photographs = models.ManyToManyField('Photograph',
                                        related_name='lightboxes',
                                        through = 'Item',
                                        symmetrical=False,
                                        verbose_name=_('photographs'),
                                        null=True, blank=True)

class Item(models.Model):
    lightbox = models.ForeignKey( Lightbox, related_name='items' )
    photograph = models.ForeignKey( Photograph, related_name='items' )
    order = models.IntegerField( unique=False )

--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to