Changes between Version 5 and Version 6 of QuerysetRefactorBranch

03/13/2008 08:30:11 PM (10 years ago)
Malcolm Tredinnick

Missed something on last update.


  • QuerysetRefactorBranch

    v5 v6  
    4646 * 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.
    4747 * If you pass a bad field name into a filter, 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.
     48 * 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:
     49   {{{
     51qs.extra(select={'a': ...}).order_by('a')     # Old style
     53qs.extra(select={'a': ...}, order_by=('a',))   # New style
     54   }}}
    4956== Work in progress ==
Back to Top