commit
13db379e8d
10
admin.py
10
admin.py
|
@ -113,11 +113,19 @@ class AuthorAdmin(ModelAdmin):
|
|||
ordering = ('name',)
|
||||
exclude = ('editions',)
|
||||
|
||||
subject_authorities = (('','keywords'),('lcsh', 'LC subjects'), ('lcc', 'LC classifications'), ('bisacsh', 'BISAC heading'), )
|
||||
class SubjectAdminForm(forms.ModelForm):
|
||||
authority = forms.ChoiceField(choices=subject_authorities, required=False )
|
||||
class Meta(object):
|
||||
model = models.Subject
|
||||
fields = 'name', 'authority', 'is_visible'
|
||||
|
||||
|
||||
class SubjectAdmin(ModelAdmin):
|
||||
search_fields = ('name',)
|
||||
date_hierarchy = 'created'
|
||||
ordering = ('name',)
|
||||
exclude = ('works',)
|
||||
form = SubjectAdminForm
|
||||
|
||||
class EditionAdminForm(forms.ModelForm):
|
||||
work = AutoCompleteSelectField(
|
||||
|
|
Loading…
Reference in New Issue