Skip to content
Browse files

Add photos belonging to a gallery to the admin interface

  • Loading branch information...
1 parent 3b1a2c5 commit e95170c88d3b1330f3da445dd4e937001b3bf74d Kasper Laudrup committed Nov 24, 2011
Showing with 7 additions and 1 deletion.
  1. +7 −1 homepage/admin.py
View
8 homepage/admin.py
@@ -1,8 +1,14 @@
from django.contrib import admin
from models import *
+class PhotoInline(admin.StackedInline):
+ model = Photo
+
+class GalleryAdmin(admin.ModelAdmin):
+ inlines = [PhotoInline]
+
admin.site.register(Post)
admin.site.register(Project)
admin.site.register(Comment)
admin.site.register(GalleryUpload)
-admin.site.register(Gallery)
+admin.site.register(Gallery, GalleryAdmin)

0 comments on commit e95170c

Please sign in to comment.
Something went wrong with that request. Please try again.