Any hints? Also on how to get them from just one collection?
Best, Simon
Matthew Westcott
unread,
Jun 27, 2016, 12:47:56 PM6/27/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to wag...@googlegroups.com
Hi Simon,
The line
photos = self.photos
needs to be:
photos = self.photos()
- otherwise, the 'photos' method won't get called (it'll just set the variable 'photos' to be a reference to the function instead).
To limit the query to a specific collection:
photos = Image.objects.filter(collection__name='Photos')
(or, if you want to identify the collection by ID rather than name: filter(collection__id=1) - see https://docs.djangoproject.com/en/1.9/ref/models/querysets/#id4 for other ways of querying.)