Another Step in the Quest to clean up the code base.

This commit is contained in:
2017-09-08 07:19:50 +02:00
parent ce218080b2
commit b3ab9798b5
229 changed files with 1915 additions and 15175 deletions

View File

@@ -1,9 +1,6 @@
"""
Created on 19.09.2011
"""Django admin interface for the event app.
@author: christian
"""
# import stuff we need from django
It's the best way to add eventseries, or edit/delete events."""
from django.contrib import admin
from django.utils.translation import gettext as _
@@ -11,12 +8,14 @@ from events.models import Event, Photo, Location
class EventInline(admin.TabularInline):
"""To list events of an eventseries below the 'master event'"""
model = Event
fields = ('name', 'start', 'end')
verbose_name_plural = _('Event Series')
class EventAdmin(admin.ModelAdmin):
"""Admin Interface to list and edit events."""
list_display = ('name', 'start', 'end', 'location',)
list_editable = ('start', 'end', 'location')
readonly_fields = ('event_series',)
@@ -27,11 +26,12 @@ class EventAdmin(admin.ModelAdmin):
class LocationAdmin(admin.ModelAdmin):
"""Admin Interace to list and edit event locations."""
list_display = ('name', 'street_address', 'postal_code', 'locality')
class PhotoAdmin(admin.ModelAdmin):
# admin_thumbnail = AdminThumbnail(image_field='thumbnail')
"""Admin Interface to list and edit photos of events."""
fields = ('image', 'event', 'name', 'description',
('photographer', 'created_date'))
list_filter = ('event', 'on_startpage',)
@@ -41,8 +41,6 @@ class PhotoAdmin(admin.ModelAdmin):
list_editable = ('on_startpage', 'name', 'event', 'photographer')
# register with CMS
admin.site.register(Event, EventAdmin)
admin.site.register(Photo, PhotoAdmin)
admin.site.register(Location, LocationAdmin)