Skip to content

Commit

Permalink
Little bit of documentation on Model Inlines
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsensible committed Nov 22, 2012
1 parent 11bf580 commit 2f8012e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,24 @@ The latter form is handy, as the ``Q`` object can be passed in as a paramter to

In addition to modifying your views, you may want to consider changing any ``get_absolute_url`` functions to correctly return the relevant URL for viewing the object - taking into account whether it is a published or draft object (using the ``is_public`` field). The ``PublishableAdmin`` class automatically provides a link to the published (View on site) and draft (Preview on site) versions if a model has implemented ``get_absolute_url``.

The classes ``PublishableStackedInline`` and ``PublishableTabularInline`` are also available for handling inline editing of ``Publishable`` child models.

::

from django.contrib import admin
from publish.admin import PublishableAdmin, PublishableTabularInline
from models import MyModel, MyChildModel
class MyChildModelInline(PublishableTabularInline):
model = MyChildModel

class MyModelAdmin(PublishableAdmin):
inlines = [ MyChildModelInline ]
admin.site.register(MyModel, MyModelAdmin)


Signals
=======

Expand Down

0 comments on commit 2f8012e

Please sign in to comment.