Additional features for django admin
Project description
IMPORTANT STEPS:
1. add 'admin_extended' before 'django.contrib.*' and 'admin_tools.*' in INSTALLED_APPS
2. add 'admin_extended.context_processors.settings' in TEMPLATE_CONTEXT_PROCESSORS
3. add 'apptemplates.Loader' in TEMPLATE_LOADERS
Package allow some extra settings to customize - all of them are optional
- ADMIN_JQUERY_ADDITIONAL_VERSION
Is a string which defines additional version of jquery - it will include from google storage
Example: ADMIN_JQUERY_ADDITIONAL_VERSION = '1.9.0'
- FAVICON_PREFIX
Is a string which defines favicon static prefix ('/static/' by default)
Example: FAVICON_PREFIX = '/static/images/'
Also it provides register_url decorator for ModelAdmin or Inline methods. It turns method to view, which returns HttpResponse object.
To use it you should add next line to yours urls.py
url(r'^admin/', include('ruadmin.urls')),
IMPORTANT: it should be placed BEFORE including admin.site.urls, but AFTER admin.autodiscover()
After then you may deco yours methods like that:
class SomeModelAdmin(ModelAdmin):
# finally url will be look like that: r'^/admin/app_label/model_name/extra_url/'
# arg must be a raw string and can not starts with /
# url arg could be omitted - "method_name/$" will be used as url
@register_url(r'extra_url/$')
def get_info(self, request):
return render_to_response('some_template.html')
At client side you could use:
- autoinlines.js (a tool to create dynamic inlines, by clicking on checkboxes controllers)
Usage: $.autoInline({
inlineName: "hint",
fields: ["field_name_1", "field_name_2"],
controllers: ["m2m_field_name_1", "m2m_field_name_2"],
requiredMask: 10,
hint: "Check m2m_field_name_1",
empty: "None"
})
- searchline.js (a tool to filter checkboxes)
Usage: $("fieldset .field-fieldname").addSearchLine();
IMPORTANT: also you must decorate your method with @staticmethod or @classmethod if you use this feture in InlineModelAdmin
NOTE: if you use this feature in InlineModelAdmin, "model_name" still be name of model registred with ModelAdmin which contains inline (so as "app_label").
To prevent it set "use_inline_data" arg to True in register_url decorator
1. add 'admin_extended' before 'django.contrib.*' and 'admin_tools.*' in INSTALLED_APPS
2. add 'admin_extended.context_processors.settings' in TEMPLATE_CONTEXT_PROCESSORS
3. add 'apptemplates.Loader' in TEMPLATE_LOADERS
Package allow some extra settings to customize - all of them are optional
- ADMIN_JQUERY_ADDITIONAL_VERSION
Is a string which defines additional version of jquery - it will include from google storage
Example: ADMIN_JQUERY_ADDITIONAL_VERSION = '1.9.0'
- FAVICON_PREFIX
Is a string which defines favicon static prefix ('/static/' by default)
Example: FAVICON_PREFIX = '/static/images/'
Also it provides register_url decorator for ModelAdmin or Inline methods. It turns method to view, which returns HttpResponse object.
To use it you should add next line to yours urls.py
url(r'^admin/', include('ruadmin.urls')),
IMPORTANT: it should be placed BEFORE including admin.site.urls, but AFTER admin.autodiscover()
After then you may deco yours methods like that:
class SomeModelAdmin(ModelAdmin):
# finally url will be look like that: r'^/admin/app_label/model_name/extra_url/'
# arg must be a raw string and can not starts with /
# url arg could be omitted - "method_name/$" will be used as url
@register_url(r'extra_url/$')
def get_info(self, request):
return render_to_response('some_template.html')
At client side you could use:
- autoinlines.js (a tool to create dynamic inlines, by clicking on checkboxes controllers)
Usage: $.autoInline({
inlineName: "hint",
fields: ["field_name_1", "field_name_2"],
controllers: ["m2m_field_name_1", "m2m_field_name_2"],
requiredMask: 10,
hint: "Check m2m_field_name_1",
empty: "None"
})
- searchline.js (a tool to filter checkboxes)
Usage: $("fieldset .field-fieldname").addSearchLine();
IMPORTANT: also you must decorate your method with @staticmethod or @classmethod if you use this feture in InlineModelAdmin
NOTE: if you use this feature in InlineModelAdmin, "model_name" still be name of model registred with ModelAdmin which contains inline (so as "app_label").
To prevent it set "use_inline_data" arg to True in register_url decorator
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
Close
Hashes for django-extended-admin-1.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f7dfadea2ce80876504d0f24a64bcdfdf424760bd901dfee3485a894147fb68 |
|
MD5 | 709939cd5acc3b4d45244d5b91666746 |
|
BLAKE2b-256 | 4124dcc5c6d50772924d28ec3a9f0263bfc29ac031b2f212a9c9f891c4aeaa5b |