30 lines
808 B
Python
30 lines
808 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 .models import *
|
|
|
|
from .forms import ExplorerCreationForm, ExplorerChangeForm
|
|
|
|
# Register your models here.
|
|
|
|
class ExplorerAdmin(UserAdmin):
|
|
add_form = ExplorerCreationForm
|
|
form = ExplorerChangeForm
|
|
model = Explorer
|
|
list_display = ['email', 'username',]
|
|
|
|
class VoucherAdmin(admin.ModelAdmin):
|
|
fields = ['code', 'expires', 'created']
|
|
readonly_fields = ['created']
|
|
|
|
admin.site.register(Explorer, ExplorerAdmin)
|
|
admin.site.register(Voucher, VoucherAdmin)
|
|
admin.site.register(Place)
|
|
admin.site.register(PlaceImage)
|
|
admin.site.register(PhotoAlbum)
|