Changes between Version 27 and Version 28 of QuerysetRefactorBranch
- Timestamp:
- Oct 29, 2009, 1:53:03 AM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
QuerysetRefactorBranch
v27 v28 30 30 31 31 === Most visible === 32 * The {{{OneToOneField}}} class has finally been updated, as the documentation has indicated would be happening for a long while. There are few externally visible changes, with one exception: a {{{OneToOneField}}} is no longer automatically the primary key for a model that includes it. It still accepts the {{{primary_key}}} attribute, however, so you should add {{{primary_key=True}}} to the declaration of any existing {{{OneToOneField}}} instances in your code to preserve backwards compatibility. 32 * The {{{OneToOneField}}} class has finally been updated, as the documentation has indicated would be happening for a long while. There are few externally visible changes, with one exception: a {{{OneToOneField}}} is no longer automatically the primary key for a model that includes it. It still accepts the {{{primary_key}}} attribute, however, so you should add {{{primary_key=True}}} to the declaration of any existing {{{OneToOneField}}} instances in your code to preserve backwards compatibility.[http://www.mustuniversity.com/Programs/Degree/Masters-Degree.html online Masters degree] 33 33 * If you pass a bad field name into a filter or {{{order_by()}}}, Django now raises {{{FieldError}}} (from {{{django.core.exceptions}}}), rather than Python's built in {{{TypeError}}}. Also, the list of legal field names is now sorted alphabetically for easier searching. This should have no effect on most production code, however some test suites may need to be updated to accommodate the changed traceback output. 34 34 * There is a slight difference between these two filter statements … … 38 38 qs.objects.filter(f1, f2) 39 39 }}} 40 This difference only applies when `f1` and `f2` are referencing the same multi-valued relationship (a `ManyToManyField` or reverse `ForeignKey`). The first version allows filtering against different items from the relationship (things that match `f1` on one object in the related table as well as `f2` on another object in the related table), whereas the second version's filters will be applied to the same item. See the [http://www.djangoproject.com/documentation/db-api/#lookups-that-span-relationships database api documentation] for details. 40 This difference only applies when `f1` and `f2` are referencing the same multi-valued relationship (a `ManyToManyField` or reverse `ForeignKey`). The first version allows filtering against different items from the relationship (things that match `f1` on one object in the related table as well as `f2` on another object in the related table), whereas the second version's filters will be applied to the same item. See the [http://www.djangoproject.com/documentation/db-api/#lookups-that-span-relationships database api documentation] for details. [http://www.mustuniversity.com/Programs/Degree/degree.asp Online degrees] | [http://www.mustuniversity.com/Programs/Degree/PhD-Degree.html phd degree] 41 41 42 * It is possible to use extra select fields -- those included via {{{extra(select=...)}}} -- for ordering the results. Previously, those fields could be specified to the {{{order_by()}}} method. Due to increased error checking, that is no longer practical. Instead, pass those extra columns to the {{{order_by}}} argument of the {{{extra()}}} method: 42 43 {{{