Changes between Version 16 and Version 17 of QuerysetRefactorBranch
- Timestamp:
- Apr 27, 2008, 1:07:36 AM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
QuerysetRefactorBranch
v16 v17 27 27 5. Querysets have a {{{reverse()}}} method that reverses whatever the current ordering is. 28 28 6. The queryset {{{values()}}} method can retrieve fields that are related via a {{{ForeignKey}}} or {{{OneToOneField}}} relation. 29 7. A new {{{values list()}}} method has been added to querysets. This is similar to {{{values()}}} except that it returns a list of tuples, rather than a list of dictionaries.29 7. A new {{{values_list()}}} method has been added to querysets. This is similar to {{{values()}}} except that it returns a list of tuples, rather than a list of dictionaries. 30 30 8. You can specify a list of related fields to traverse in a {{{select_related()}}} call. This provides a way to select only the related data you are interested in. Only single-valued relations can be selected in this way, however (not {{{ManyToManyFields}}}). 31 31 9. Filtering a queryset by checking if a field attribute is {{{None}}} is equivalent to testing if the corresponding database column is {{{NULL}}}. So {{{qs.filter(foo=None)}}} is now identical to {{{qs.filter(foo__isnull=True)}}}.