django-admin2/README.rst

57 lines
1.8 KiB
ReStructuredText
Raw Normal View History

2013-05-14 12:12:32 +00:00
===============
django-admin2
===============
One of the most useful parts of ``django.contrib.admin`` is the ability to configure various views that touch and alter data. django-admin2 is a complete rewrite of that library using modern Class-Based Views and enjoying a design focused on extendibility. By starting over, we can avoid the legacy code and make it easier to write extensions and themes.
2013-05-18 06:44:31 +00:00
**Note:** This is pre-alpha and currently non-functional. We'll try and have a rough working prototype by the end of May 18th, 2013.
Contributing
=============
Yes please! Please read our formal contributing document at: https://github.com/pydanny/django-admin2/blob/master/docs/contributing.rst
2013-05-14 12:12:32 +00:00
Basic Pattern
==============
Our goal is to make this API work:
.. code-block:: python
2013-05-14 12:12:32 +00:00
# myapp/admin2.py
2013-05-14 12:37:11 +00:00
# Import the Admin2 base class
2013-05-18 11:30:45 +00:00
from admin2.models import Admin2
2013-05-14 12:12:32 +00:00
# Import your custom models
from blog.models import Post
2013-05-14 12:37:11 +00:00
# Instantiate the Admin2 class
# Then attach the admin2 object to your model
Post.admin2 = Admin2()
2013-05-17 10:38:39 +00:00
2013-05-14 12:12:32 +00:00
.. note:: You will notice a difference between how and django.contrib.admin and django-admin2 do configuration. The former associates the configuration class with the model object via a registration utility, and the latter does so by adding the configuration class as an attribute of the model object.
Themes
========
The default theme is whatever bootstrap is most current. Specifically:
.. code-block:: python
2013-05-18 10:57:01 +00:00
ADMIN2_THEME_DIRECTORY = "admin2/bootstrap/"
If you create a new theme, please define it thus:
.. code-block:: python
2013-05-18 10:57:01 +00:00
ADMIN2_THEME_DIRECTORY = "admin2/foundation/"
REST API
==========
2013-05-17 22:17:56 +00:00
We plan to expose a REST API using Django Rest Framework. From this, you can define new themes powered by the client framework of your choice.