Project_Camper/vagus/reservation/admin.py
2021-02-06 12:31:59 +01:00

24 lines
757 B
Python
Executable File

from django.contrib import admin
from .models import Reservation
from .forms import ReservationForm
class CustomReservation(admin.ModelAdmin):
model = Reservation
list_display = ('created_date','user','offer','reservation_start_date','reservation_end_date','reservation_cost')
fieldsets = (
(None, {'fields': ('user','offer','reservation_start_date','reservation_end_date','status','message_to_owner',)}),
)
add_fieldsets = (
(None, {
'classes': ('wide',),
'fields': ('user','offer','reservation_start_date','reservation_end_date','status',)}
),
)
ordering = ('offer','user')
search_fields = ('offer','user')
admin.site.register(Reservation, CustomReservation)