mirror of
https://github.com/jazzband/django-eav2.git
synced 2026-03-16 22:40:26 +00:00
admin fixes:- switch order of objects and on_site properties on Attribute so that all Attributes are listed in the admin- add site to list_display and list_filter
This commit is contained in:
parent
bd541d5fb7
commit
17a0bf4203
2 changed files with 3 additions and 3 deletions
|
|
@ -27,7 +27,6 @@ from django.utils.safestring import mark_safe
|
|||
|
||||
from .models import Attribute, Value, EnumValue, EnumGroup
|
||||
|
||||
|
||||
class BaseEntityAdmin(ModelAdmin):
|
||||
|
||||
def render_change_form(self, request, context, add=False, change=False, form_url='', obj=None):
|
||||
|
|
@ -95,7 +94,8 @@ class BaseEntityInline(InlineModelAdmin):
|
|||
return [(None, {'fields': form.fields.keys()})]
|
||||
|
||||
class AttributeAdmin(ModelAdmin):
|
||||
list_display = ('name', 'slug', 'datatype', 'description')
|
||||
list_display = ('name', 'slug', 'datatype', 'description', 'site')
|
||||
list_filter = ['site']
|
||||
prepopulated_fields = {'slug': ('name',)}
|
||||
|
||||
admin.site.register(Attribute, AttributeAdmin)
|
||||
|
|
|
|||
|
|
@ -204,8 +204,8 @@ class Attribute(models.Model):
|
|||
|
||||
required = models.BooleanField(_(u"required"), default=False)
|
||||
|
||||
on_site = CurrentSiteManager()
|
||||
objects = models.Manager()
|
||||
on_site = CurrentSiteManager()
|
||||
|
||||
def get_validators(self):
|
||||
'''
|
||||
|
|
|
|||
Loading…
Reference in a new issue