Add extended fields to the Photo and Gallery
This commit is contained in:
parent
6ea1a7c77f
commit
27b1590a10
3 changed files with 154 additions and 2 deletions
|
|
@ -1,6 +1,6 @@
|
|||
from django.contrib import admin
|
||||
|
||||
from .models import Gallery, Photo
|
||||
from .models import Gallery, Photo, Tag
|
||||
|
||||
|
||||
class GalleryAdmin(admin.ModelAdmin):
|
||||
|
|
@ -9,7 +9,7 @@ class GalleryAdmin(admin.ModelAdmin):
|
|||
date_hierarchy = 'date_added'
|
||||
prepopulated_fields = {'slug': ('title',)}
|
||||
model = Gallery
|
||||
autocomplete_fields = ['photos', ]
|
||||
autocomplete_fields = ['photos', 'tags']
|
||||
search_fields = ['title', ]
|
||||
|
||||
|
||||
|
|
@ -22,3 +22,12 @@ class PhotoAdmin(admin.ModelAdmin):
|
|||
prepopulated_fields = {'slug': ('title',)}
|
||||
readonly_fields = ('date_taken',)
|
||||
model = Photo
|
||||
|
||||
|
||||
class TagAdmin(admin.ModelAdmin):
|
||||
list_display = ('name',)
|
||||
search_fields = ('name',)
|
||||
model = Tag
|
||||
|
||||
|
||||
admin.site.register(Tag, TagAdmin)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue