- commit
- 1eb11d11de9bbd89834c2158af9ff62bfdeffed8
- parent
- 4be7a5334020e2114f5f5b1a8b27a9dc219f334b
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2019-08-22 21:43
add admin
Diffstat
| A | rebelstuff/admin.py | 24 | ++++++++++++++++++++++++ |
1 files changed, 24 insertions, 0 deletions
diff --git a/rebelstuff/admin.py b/rebelstuff/admin.py
@@ -0,0 +1,24 @@ -1 1 from django.contrib import admin -1 2 -1 3 from . import models -1 4 -1 5 -1 6 class StuffAdmin(admin.ModelAdmin): -1 7 list_display = ['name', 'amount'] -1 8 search_fields = ['name'] -1 9 -1 10 -1 11 class BookingItemInline(admin.TabularInline): -1 12 model = models.BookingItem -1 13 autocomplete_fields = ['stuff'] -1 14 -1 15 -1 16 class BookingAdmin(admin.ModelAdmin): -1 17 list_display = ['name', 'start', 'end'] -1 18 date_hierarchy = 'start' -1 19 search_fields = ['name'] -1 20 inlines = [BookingItemInline] -1 21 -1 22 -1 23 admin.site.register(models.Stuff, StuffAdmin) -1 24 admin.site.register(models.Booking, BookingAdmin)