2020-07-31 14:55:26 +02:00
|
|
|
#!/usr/bin/env python
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
''' Classes and modules for the administrative backend. '''
|
|
|
|
|
2020-07-19 00:13:49 +02:00
|
|
|
from django.contrib import admin
|
2020-07-28 20:15:34 +02:00
|
|
|
from django.contrib.auth import get_user_model
|
|
|
|
from django.contrib.auth.admin import UserAdmin
|
2020-09-11 19:15:39 +02:00
|
|
|
from lostplaces_app.models import *
|
2020-07-19 00:13:49 +02:00
|
|
|
|
2020-09-11 19:15:39 +02:00
|
|
|
from lostplaces_app.forms import ExplorerCreationForm, ExplorerChangeForm
|
2020-07-28 20:15:34 +02:00
|
|
|
|
2020-07-19 00:13:49 +02:00
|
|
|
# Register your models here.
|
|
|
|
|
2020-08-01 13:31:52 +02:00
|
|
|
class VoucherAdmin(admin.ModelAdmin):
|
2020-09-11 22:03:20 +02:00
|
|
|
fields = ['code', 'expires_when', 'created_when']
|
|
|
|
readonly_fields = ['created_when']
|
2020-08-01 13:31:52 +02:00
|
|
|
|
2020-09-10 22:30:29 +02:00
|
|
|
admin.site.register(Explorer)
|
2020-08-01 13:31:52 +02:00
|
|
|
admin.site.register(Voucher, VoucherAdmin)
|
2020-07-19 00:13:49 +02:00
|
|
|
admin.site.register(Place)
|
2020-07-31 14:55:26 +02:00
|
|
|
admin.site.register(PlaceImage)
|
2020-08-26 21:36:10 +02:00
|
|
|
admin.site.register(PhotoAlbum)
|