Django

Code

Show
Ignore:
Timestamp:
06/17/07 17:18:54 (2 years ago)
Author:
clong
Message:

per-object-permissions: Merged to trunk [5486] NOTE: Not fully tested, will be working on this over the next few weeks.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/per-object-permissions/docs/generic_views.txt

    r4242 r5488  
    4545       (r'^(?P<year>\d{4})/(?P<month>[a-z]{3})/$',                                'archive_month', info_dict), 
    4646       (r'^(?P<year>\d{4})/$',                                                    'archive_year',  info_dict), 
    47        (r'^/?$',                                                                  'archive_index', info_dict), 
     47       (r'^$',                                                                    'archive_index', info_dict), 
    4848    ) 
    4949 
     
    7272lambda that returns the QuerySet. 
    7373 
    74 .. _database API docs: http://www.djangoproject.com/documentation/db_api/ 
     74.. _database API docs: ../db-api/ 
    7575 
    7676"Simple" generic views 
     
    9898      context. By default, this is an empty dictionary. If a value in the 
    9999      dictionary is callable, the generic view will call it 
    100       just before rendering the template. (**This is new in the 
    101       Django development version.**) 
    102        
     100      just before rendering the template. 
     101 
     102    * ``mimetype``: The MIME type to use for the resulting document. Defaults 
     103      to the value of the ``DEFAULT_CONTENT_TYPE`` setting. 
     104 
    103105**Example:** 
    104106 
     
    206208 
    207209    * ``<model_name>`` is your model's name in all lowercase. For a model 
    208         ``StaffMember``, that'd be ``staffmember``. 
     210      ``StaffMember``, that'd be ``staffmember``. 
    209211 
    210212    * ``<app_label>`` is the right-most part of the full Python path to 
    211         your model's app. For example, if your model lives in 
    212         ``apps/blog/models.py``, that'd be ``blog``. 
     213      your model's app. For example, if your model lives in 
     214      ``apps/blog/models.py``, that'd be ``blog``. 
    213215 
    214216**Template context:** 
     
    224226      ``latest`` will be a list of the latest 10 objects in ``queryset``. 
    225227 
    226 .. _RequestContext docs: http://www.djangoproject.com/documentation/templates_python/#subclassing-context-djangocontext 
     228.. _RequestContext docs: ../templates_python/#subclassing-context-requestcontext 
    227229 
    228230``django.views.generic.date_based.archive_year`` 
     
    267269 
    268270    * ``template_object_name``:  Designates the name of the template variable 
    269       to use in the template context. By default, this is ``'object'``. The 
    270       view will append ``'_list'`` to the value of this parameter in 
    271       determining the variable's name. 
     271      to use in the template context. By default, this is ``'object'``. The 
     272      view will append ``'_list'`` to the value of this parameter in 
     273      determining the variable's name. 
    272274 
    273275    * ``make_object_list``: A boolean specifying whether to retrieve the full 
     
    361363 
    362364    * ``template_object_name``:  Designates the name of the template variable 
    363       to use in the template context. By default, this is ``'object'``. The 
    364       view will append ``'_list'`` to the value of this parameter in 
    365       determining the variable's name. 
     365      to use in the template context. By default, this is ``'object'``. The 
     366      view will append ``'_list'`` to the value of this parameter in 
     367      determining the variable's name. 
    366368 
    367369    * ``mimetype``: The MIME type to use for the resulting document. Defaults 
     
    442444 
    443445    * ``template_object_name``:  Designates the name of the template variable 
    444       to use in the template context. By default, this is ``'object'``. The 
    445       view will append ``'_list'`` to the value of this parameter in 
    446       determining the variable's name. 
     446      to use in the template context. By default, this is ``'object'``. The 
     447      view will append ``'_list'`` to the value of this parameter in 
     448      determining the variable's name. 
    447449 
    448450    * ``mimetype``: The MIME type to use for the resulting document. Defaults 
     
    527529 
    528530    * ``template_object_name``:  Designates the name of the template variable 
    529       to use in the template context. By default, this is ``'object'``. The 
    530       view will append ``'_list'`` to the value of this parameter in 
    531       determining the variable's name. 
     531      to use in the template context. By default, this is ``'object'``. The 
     532      view will append ``'_list'`` to the value of this parameter in 
     533      determining the variable's name. 
    532534 
    533535    * ``mimetype``: The MIME type to use for the resulting document. Defaults 
     
    639641 
    640642    * ``template_object_name``:  Designates the name of the template variable 
    641       to use in the template context. By default, this is ``'object'``. 
     643      to use in the template context. By default, this is ``'object'``. 
    642644 
    643645    * ``mimetype``: The MIME type to use for the resulting document. Defaults 
     
    687689      displayed per page. If this is given, the view will paginate objects with 
    688690      ``paginate_by`` objects per page. The view will expect either a ``page`` 
    689       query string parameter (via ``GET``) containing a zero-indexed page 
     691      query string parameter (via ``GET``) containing a 1-based page 
    690692      number, or a ``page`` variable specified in the URLconf. See 
    691693      "Notes on pagination" below. 
     
    711713 
    712714    * ``template_object_name``:  Designates the name of the template variable 
    713       to use in the template context. By default, this is ``'object'``. The 
    714       view will append ``'_list'`` to the value of this parameter in 
    715       determining the variable's name. 
     715      to use in the template context. By default, this is ``'object'``. The 
     716      view will append ``'_list'`` to the value of this parameter in 
     717      determining the variable's name. 
    716718 
    717719    * ``mimetype``: The MIME type to use for the resulting document. Defaults 
     
    752754 
    753755    * ``previous``: The previous page number, as an integer. This is 1-based. 
     756 
     757    * `last_on_page`: The number of the 
     758      last result on the current page. This is 1-based. 
     759 
     760    * `first_on_page`: The number of the 
     761      first result on the current page. This is 1-based. 
    754762 
    755763    * ``pages``: The total number of pages, as an integer. 
     
    825833 
    826834    * ``template_object_name``:  Designates the name of the template variable 
    827       to use in the template context. By default, this is ``'object'``. 
     835      to use in the template context. By default, this is ``'object'``. 
    828836 
    829837    * ``mimetype``: The MIME type to use for the resulting document. Defaults 
     
    917925      about using ``FormWrapper`` objects in templates. 
    918926 
    919 .. _authentication system: http://www.djangoproject.com/documentation/authentication/ 
    920 .. _manipulator and formfield documentation: http://www.djangoproject.com/documentation/forms/ 
     927.. _authentication system: ../authentication/ 
     928.. _manipulator and formfield documentation: ../forms/ 
    921929 
    922930``django.views.generic.create_update.update_object`` 
     
    974982 
    975983    * ``template_object_name``:  Designates the name of the template variable 
    976       to use in the template context. By default, this is ``'object'``. 
     984      to use in the template context. By default, this is ``'object'``. 
    977985 
    978986**Template name:** 
     
    10551063 
    10561064    * ``template_object_name``:  Designates the name of the template variable 
    1057       to use in the template context. By default, this is ``'object'``. 
     1065      to use in the template context. By default, this is ``'object'``. 
    10581066 
    10591067**Template name:**