KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
need to get a queryset with the first book (by a date field) for each author (related to by foreign key) ...is there a Django ORM way to do this (without custom SQL preferred but acceptable) *Edit: Please note that an answer that works using only a modern open source backend like Postgresql is acceptable ..still ORM based solution preferred over pure custom sql query) Models class Book(Model): date = Datefield() author = ForeignKey(Author) class Author(Model): name = CharField() Book.objects.filter(??)
Tags (comma-separated)
Save Edits
Cancel