Merge pull request #521 from Gluejar/fix-subject-edit

add select widget for authority
pull/1/head
Raymond Yee 2015-08-28 21:58:27 -04:00
commit 13db379e8d
1 changed files with 10 additions and 2 deletions

View File

@ -113,12 +113,20 @@ 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(
WorkLookup,