Django

Code

Show
Ignore:
Timestamp:
03/20/08 14:56:44 (10 months ago)
Author:
mtredinnick
Message:

queryset-refactor: Merged from trunk up to [7338].

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/queryset-refactor/docs/model-api.txt

    r7281 r7341  
    627627~~~~~~~~~~~ 
    628628 
    629 The default value for the field. 
     629The default value for the field. This can be a value or a callable object. If 
     630callable it will be called every time a new object is created. 
    630631 
    631632``editable`` 
     
    18151816and ``Person.people.all()``, yielding predictable results. 
    18161817 
    1817 If you use custom ``Manager`` objects, take note that the first ``Manager`` 
    1818 Django encounters (in order by which they're defined in the model) has a 
    1819 special status. Django interprets the first ``Manager`` defined in a class as 
    1820 the "default" ``Manager``. Certain operations -- such as Django's admin site -- 
    1821 use the default ``Manager`` to obtain lists of objects, so it's generally a 
    1822 good idea for the first ``Manager`` to be relatively unfiltered. In the last 
    1823 example, the ``people`` ``Manager`` is defined first -- so it's the default 
    1824 ``Manager``. 
     1818If you use custom ``Manager`` objects, take note that the first 
     1819``Manager`` Django encounters (in the order in which they're defined 
     1820in the model) has a special status. Django interprets this first 
     1821``Manager`` defined in a class as the "default" ``Manager``, and 
     1822several parts of Django (though not the admin application) will use 
     1823that ``Manager`` exclusively for that model. As a result, it's often a 
     1824good idea to be careful in your choice of default manager, in order to 
     1825avoid a situation where overriding of ``get_query_set()`` results in 
     1826an inability to retrieve objects you'd like to work with. 
    18251827 
    18261828Model methods