20 lines
709 B
Python
20 lines
709 B
Python
from django.contrib import admin
|
|
from .models import Property, Guest, Stay, Campaign
|
|
|
|
@admin.register(Property)
|
|
class PropertyAdmin(admin.ModelAdmin):
|
|
list_display = ('name', 'address', 'created_at')
|
|
|
|
@admin.register(Guest)
|
|
class GuestAdmin(admin.ModelAdmin):
|
|
list_display = ('first_name', 'last_name', 'email', 'phone', 'created_at')
|
|
search_fields = ('first_name', 'last_name', 'email')
|
|
|
|
@admin.register(Stay)
|
|
class StayAdmin(admin.ModelAdmin):
|
|
list_display = ('guest', 'property', 'check_in', 'check_out', 'total_nights')
|
|
list_filter = ('property', 'check_in')
|
|
|
|
@admin.register(Campaign)
|
|
class CampaignAdmin(admin.ModelAdmin):
|
|
list_display = ('title', 'subject', 'status', 'sent_at') |