admin.py 335 Bytes
Newer Older
1
from django.contrib import admin
2
3
4
5
6
from website.models import Restaurant, Schedule, OpenTime


class OpenTimeInline(admin.TabularInline):
    model = OpenTime
7
    fk_name = 'schedule'
8
9
10
11
12


class ScheduleAdmin(admin.ModelAdmin):
    inlines = [OpenTimeInline, ]

13
14

admin.site.register(Restaurant)
15
admin.site.register(Schedule, ScheduleAdmin)