troggle-unchained/expo/admin.py
substantialnoninfringinguser b950ee70f7 [svn]
Copied from http://cucc@cucc.survex.com/svn/trunk/expoweb/troggle/, rev. 8175 by aaron @ 1/18/2009 4:42 AM
2009-05-13 05:35:29 +01:00

46 lines
1.3 KiB
Python

from troggle.expo.models import *
from django.contrib import admin
class RoleInline(admin.TabularInline):
model = PersonRole
extra = 4
class SurvexBlockAdmin(admin.ModelAdmin):
inlines = (RoleInline,)
class ScannedImageInline(admin.TabularInline):
model = ScannedImage
extra = 4
class SurveyAdmin(admin.ModelAdmin):
inlines = (ScannedImageInline,)
class LogbookEntryAdmin(admin.ModelAdmin):
search_fields = ('title',)
class PersonAdmin(admin.ModelAdmin):
search_fields = ('first_name','last_name')
class PersonExpeditionAdmin(admin.ModelAdmin):
search_fields = ('person__first_name',)
admin.site.register(Photo)
admin.site.register(Cave)
admin.site.register(Area)
admin.site.register(OtherCaveName)
admin.site.register(CaveAndEntrance)
admin.site.register(SurveyStation)
admin.site.register(Entrance)
admin.site.register(SurvexBlock, SurvexBlockAdmin)
admin.site.register(Expedition)
admin.site.register(Person,PersonAdmin)
admin.site.register(PersonRole)
admin.site.register(PersonExpedition,PersonExpeditionAdmin)
admin.site.register(Role)
admin.site.register(LogbookEntry, LogbookEntryAdmin)
admin.site.register(PersonTrip)
admin.site.register(QM)
admin.site.register(Survey, SurveyAdmin)
admin.site.register(ScannedImage)