Extensions for django-xadmin
Project description
Extra features for django-xadmin
New features:
Form wizard class working like django form wizard.
Allow adding custom menu entries via AppConfig.
django-hstore support when editing objects.
Views for external apps:
Form wizard
Integrate Django FormWizards with xadmin views:
Any view using a wizard should inherit from FormWizardAdminView
from xadmin_extras.wizard import FormWizardAdminView, SessionWizardViewMixin
class NotificateView(SessionWizardViewMixin, FormWizardAdminView):
"""A wizard view working together with xadmin, using
SessionWizard backend
"""
form_list = [SelectFilterForm, NotificateForm]
form_template = 'admin/fbapps/notificate_form.html'
title = 'FB Push notifications'
Other wizard backends are available: SessionWizardViewMixin and CookieWizardViewMixin
For more info about Form wizard, see django documentation
To register a view to be available at admin, with name and protected, use register_view():
import xadmin
xadmin.site.register_view(
r'fbapps/notificate/$', NotificateView,
name='fbapps_notification_view')
django-hstore support
Add the widget XadminHStoreWidget to your form definition:
from django_hstore.forms import DictionaryField
from xadmin_extras.django_hstore.widgets import XAdminHStoreWidget
from django import forms
class HStoreForm(forms.Form):
data = DictionaryField(widget=XadminHStoreWidget())
External apps support
Apps with custom views are defined at ext folder
django-celery
import xadmin_extras.ext.celery as ext_celery xadmin.site.register( ext_celery.celery_models.PeriodicTask, ext_celery.PeriodicTaskAdmin) xadmin.site.register( ext_celery.celery_models.IntervalSchedule, ext_celery.IntervalScheduleAdmin) xadmin.site.register( ext_celery.celery_models.CrontabSchedule, ext_celery.CrontabScheduleAdmin)
django-settings
import xadmin_extras.ext.settings as ext_settings xadmin.site.register(ext_settings.models.Setting, ext_settings.SettingsAdmin)
django-mail-factory
(By default, the mails will be at URL: /admin/mails/)
from xadmin.views import CommAdminView, filter_hook, FormAdminView import xadmin_extras.ext.mailfactory as ext_mailfactory xadmin.site.register_view( r'^mails/$', ext_mailfactory.MailListView, name='mail_factory_list') xadmin.site.register_view( r'^mails/(?P<mail_name>.*)/$',ext_mailfactory.MailFormView, name='mail_factory_form') xadmin.site.register_view( r'^mails/(?P<mail_name>.*)/preview/(?P<lang>\w+)/$', ext_mailfactory.MailPreviewMessageView, name='mail_factory_preview_message')
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file django-xadmin-extras-0.15.tar.gz
.
File metadata
- Download URL: django-xadmin-extras-0.15.tar.gz
- Upload date:
- Size: 15.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f7e9db86993bb81943a2589fc13036021641951e0b50bf341517c2602d8cd39 |
|
MD5 | b29eb3a93a37ead1691b2d9997fc4439 |
|
BLAKE2b-256 | a1f3191ebe9248cf1500c5fdffb2a70694392731303928e4f96c607d4f66dd30 |