30 lines
		
	
	
		
			886 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			886 B
		
	
	
	
		
			Python
		
	
	
	
	
	
#!/usr/bin/env python
 | 
						|
# -*- coding: utf-8 -*-
 | 
						|
 | 
						|
''' Classes and modules for the administrative backend. '''
 | 
						|
 | 
						|
from django.contrib import admin
 | 
						|
from django.contrib.auth import get_user_model
 | 
						|
from django.contrib.auth.admin import UserAdmin
 | 
						|
from lostplaces.models import *
 | 
						|
 | 
						|
from lostplaces.forms import ExplorerCreationForm, ExplorerChangeForm
 | 
						|
 | 
						|
# Register your models here.
 | 
						|
 | 
						|
class VoucherAdmin(admin.ModelAdmin):
 | 
						|
    fields = ['code', 'expires_when', 'created_when']
 | 
						|
    readonly_fields = ['created_when']
 | 
						|
 | 
						|
class PhotoAlbumsAdmin(admin.ModelAdmin):
 | 
						|
    list_display = ('label', 'place', 'url' )
 | 
						|
 | 
						|
class PlacesAdmin(admin.ModelAdmin):
 | 
						|
    list_display = ('name', 'submitted_by', 'submitted_when')
 | 
						|
 | 
						|
admin.site.register(Explorer)
 | 
						|
admin.site.register(Voucher, VoucherAdmin)
 | 
						|
admin.site.register(Place, PlacesAdmin)
 | 
						|
admin.site.register(PlaceImage)
 | 
						|
admin.site.register(PhotoAlbum, PhotoAlbumsAdmin)
 |