django-admin2/example/blog/admin2.py

21 lines
500 B
Python
Raw Normal View History

2013-05-18 10:57:01 +00:00
# Import your custom models
2013-05-18 11:12:12 +00:00
from .models import Post, Comment
from django.contrib.auth.forms import UserCreationForm, UserChangeForm
from django.contrib.auth.models import User
2013-05-18 10:57:01 +00:00
import djadmin2
from djadmin2.models import ModelAdmin2
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)
2013-05-19 08:09:12 +00:00
djadmin2.default.register(User, UserAdmin2)