more widgets for the django admin
Project description
django-admin-xtra-widgets
===============================================
Overview
------------------------------------
more widgets for the django admin
Quick start
------------------------------------
If you need the SelectAndLink widget
In settings.py, add 'admin_xtra_widgets' to the INSTALLED_APPS
In urls.py add ``(r'^admin-xtra-widgets/', include('admin_extra_widgets.urls'))`` to your urlpatterns
VerboseManyToManyRawIdWidget
------------------------------------
This widget adds a clickable text value to the usual raw_id widget. It indicates the current values of the field
In your admin
from admin_xtra_widgets.widgets import VerboseManyToManyRawIdWidget
class YourAdmin(admin.ModelAdmin):
#raw_id_fields = ["your_m2m_field"]
def formfield_for_dbfield(self, db_field, **kwargs):
if db_field.name in ('your_m2m_field', 'other_m2m_field'):
kwargs['widget'] = VerboseManyToManyRawIdWidget(db_field.rel, self.admin_site)
else:
return super(YourAdmin,self).formfield_for_dbfield(db_field,**kwargs)
kwargs.pop('request')
return db_field.formfield(**kwargs)
License
=======
django-favman is licensed under the GNU-LGPL
===============================================
Overview
------------------------------------
more widgets for the django admin
Quick start
------------------------------------
If you need the SelectAndLink widget
In settings.py, add 'admin_xtra_widgets' to the INSTALLED_APPS
In urls.py add ``(r'^admin-xtra-widgets/', include('admin_extra_widgets.urls'))`` to your urlpatterns
VerboseManyToManyRawIdWidget
------------------------------------
This widget adds a clickable text value to the usual raw_id widget. It indicates the current values of the field
In your admin
from admin_xtra_widgets.widgets import VerboseManyToManyRawIdWidget
class YourAdmin(admin.ModelAdmin):
#raw_id_fields = ["your_m2m_field"]
def formfield_for_dbfield(self, db_field, **kwargs):
if db_field.name in ('your_m2m_field', 'other_m2m_field'):
kwargs['widget'] = VerboseManyToManyRawIdWidget(db_field.rel, self.admin_site)
else:
return super(YourAdmin,self).formfield_for_dbfield(db_field,**kwargs)
kwargs.pop('request')
return db_field.formfield(**kwargs)
License
=======
django-favman is licensed under the GNU-LGPL
Project details
Release history Release notifications | RSS feed
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-admin-xtra-widgets-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e04aa86009d597e4e7e252e3f2e9ae0ed9f347f8104fcab4051fb6283359bd3b |
|
MD5 | 92914112f845b6e4949004a1f7b70ce8 |
|
BLAKE2b-256 | ff602d41899b20bc763e9163d813ec18c3f1687623e067e7aa81886517c89e5c |