from mongoadmin import site, DocumentAdmin from app.models import AppDocument class AppDocumentAdmin(DocumentAdmin): pass site.register(AppDocument, AppDocumentAdmin)
from mongoadmin import site, DocumentAdmin from blog.models import Blog class BlogAdmin(DocumentAdmin): pass site.register(Blog, BlogAdmin)
'has_absolute_url': False, 'opts': self.model._meta, 'original': user, 'save_as': False, 'show_save': True, } return TemplateResponse(request, self.change_user_password_template or 'admin/auth/user/change_password.html', context, current_app=self.admin_site.name) def response_add(self, request, obj, post_url_continue=None): """ Determines the HttpResponse for the add_view stage. It mostly defers to its superclass implementation but is customized because the User model has a slightly different workflow. """ # We should allow further modification of the user just added i.e. the # 'Save' button should behave like the 'Save and continue editing' # button except in two scenarios: # * The user has pressed the 'Save and add another' button # * We are adding a user in a popup if '_addanother' not in request.POST and '_popup' not in request.POST: request.POST['_continue'] = 1 return super(MongoUserAdmin, self).response_add(request, obj, post_url_continue) if MongoUser == get_user_model() and \ getattr(settings, 'MONGOENGINE_USER_DOCUMENT', '') == 'mongoengine.django.auth.User': site.register(User, MongoUserAdmin)
'save_as': False, 'show_save': True, } return TemplateResponse(request, self.change_user_password_template or 'admin/auth/user/change_password.html', context, current_app=self.admin_site.name) def response_add(self, request, obj, post_url_continue=None): """ Determines the HttpResponse for the add_view stage. It mostly defers to its superclass implementation but is customized because the User model has a slightly different workflow. """ # We should allow further modification of the user just added i.e. the # 'Save' button should behave like the 'Save and continue editing' # button except in two scenarios: # * The user has pressed the 'Save and add another' button # * We are adding a user in a popup if '_addanother' not in request.POST and '_popup' not in request.POST: request.POST['_continue'] = 1 return super(MongoUserAdmin, self).response_add(request, obj, post_url_continue) if MongoUser == get_user_model() and \ getattr(settings, 'MONGOENGINE_USER_DOCUMENT', '') == 'mongoengine.django.auth.User': site.register(User, MongoUserAdmin)
from mongoengine.django.auth import User from mongoadmin import site, DocumentAdmin from .models import Accion class AccionAdmin(DocumentAdmin): list_display = ('get_username', 'tipo', 'url') class UserAdmin(DocumentAdmin): pass site.register(User, UserAdmin) site.register(Accion, AccionAdmin)
__author__ = 'johnb' from mongoadmin import site, DocumentAdmin, mongohelpers #mongohelpers.autodiscover() from md5checks.models import Image, Product class ImageAdmin(DocumentAdmin): pass site.register(Image, ImageAdmin) class ProductAdmin(DocumentAdmin): pass site.register(Product, ProductAdmin)