2013-05-18 11:00:51 +00:00
|
|
|
Welcome to django-admin2's documentation!
|
|
|
|
|
=========================================
|
|
|
|
|
|
2013-05-18 11:05:19 +00:00
|
|
|
**django-admin2** aims to replace django's builtin admin that lives in
|
|
|
|
|
``django.contrib.admin``. Come and help us, have a look at the
|
|
|
|
|
:doc:`contributing` page and see our `GitHub`_ page.
|
|
|
|
|
|
2013-05-18 11:30:45 +00:00
|
|
|
Basic API
|
|
|
|
|
==============
|
|
|
|
|
|
|
|
|
|
Our goal is to make this API work:
|
|
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
2013-05-18 16:09:59 +00:00
|
|
|
# Import your custom models
|
|
|
|
|
from .models import Post, Comment
|
|
|
|
|
from django.contrib.auth.forms import UserCreationForm, UserChangeForm
|
|
|
|
|
from django.contrib.auth.models import User
|
2013-05-18 11:30:45 +00:00
|
|
|
|
2013-05-18 16:09:59 +00:00
|
|
|
import djadmin2
|
|
|
|
|
from djadmin2.models import ModelAdmin2
|
2013-05-18 11:30:45 +00:00
|
|
|
|
|
|
|
|
|
2013-05-18 16:09:59 +00:00
|
|
|
class UserAdmin2(ModelAdmin2):
|
|
|
|
|
create_form_class = UserCreationForm
|
|
|
|
|
update_form_class = UserChangeForm
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Register each model with the admin
|
|
|
|
|
djadmin2.default.register(Post)
|
|
|
|
|
djadmin2.default.register(Comment)
|
|
|
|
|
djadmin2.default.register(User, UserAdmin2)
|
2013-05-18 11:30:45 +00:00
|
|
|
|
|
|
|
|
|
2013-05-18 11:05:19 +00:00
|
|
|
.. _GitHub: https://github.com/pydanny/django-admin2
|
|
|
|
|
|
|
|
|
|
Content
|
|
|
|
|
-------
|
2013-05-18 11:00:51 +00:00
|
|
|
|
|
|
|
|
.. toctree::
|
|
|
|
|
:maxdepth: 2
|
|
|
|
|
|
2013-05-18 11:05:19 +00:00
|
|
|
contributing
|
2013-05-18 11:53:16 +00:00
|
|
|
design
|
2013-05-18 14:32:22 +00:00
|
|
|
meta
|
2013-05-18 11:00:51 +00:00
|
|
|
|
|
|
|
|
Indices and tables
|
|
|
|
|
==================
|
|
|
|
|
|
|
|
|
|
* :ref:`genindex`
|
|
|
|
|
* :ref:`modindex`
|
|
|
|
|
* :ref:`search`
|
|
|
|
|
|