mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
Fixed #5968 -- Allowed (un-)registering with databrowse several models at once.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17405 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
4a3aceed3f
commit
1cc800783c
3 changed files with 17 additions and 11 deletions
|
@ -33,13 +33,18 @@ How to use Databrowse
|
|||
2. Register a number of models with the Databrowse site::
|
||||
|
||||
from django.contrib import databrowse
|
||||
from myapp.models import SomeModel, SomeOtherModel
|
||||
from myapp.models import SomeModel, SomeOtherModel, YetAnotherModel
|
||||
|
||||
databrowse.site.register(SomeModel)
|
||||
databrowse.site.register(SomeOtherModel)
|
||||
databrowse.site.register(SomeOtherModel, YetAnotherModel)
|
||||
|
||||
Note that you should register the model *classes*, not instances.
|
||||
|
||||
.. versionchanged:: 1.4
|
||||
|
||||
Since Django 1.4, it is possible to register several models in the same
|
||||
call to :func:`~databrowse.site.register`.
|
||||
|
||||
It doesn't matter where you put this, as long as it gets executed at some
|
||||
point. A good place for it is in your :doc:`URLconf file
|
||||
</topics/http/urls>` (``urls.py``).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue