2017-08-13 14:48:16 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
2017-08-11 18:32:02 +00:00
|
|
|
from django.contrib import admin
|
|
|
|
|
2017-08-13 19:51:25 +00:00
|
|
|
from .models import Baby, DiaperChange, Feeding, Sleep, TummyTime
|
2017-08-13 14:48:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
@admin.register(Baby)
|
|
|
|
class BabyAdmin(admin.ModelAdmin):
|
|
|
|
list_display = ('first_name', 'last_name', 'birth_date',)
|
|
|
|
search_fields = ('first_name', 'last_name', 'birth_date',)
|
|
|
|
|
|
|
|
|
2017-08-13 19:51:25 +00:00
|
|
|
@admin.register(DiaperChange)
|
|
|
|
class DiaperChangeAdmin(admin.ModelAdmin):
|
|
|
|
list_display = ('baby', 'time', 'wet', 'solid', 'color')
|
|
|
|
search_fields = ('baby__first_name', 'baby__last_name',)
|
|
|
|
|
|
|
|
|
2017-08-13 15:59:14 +00:00
|
|
|
@admin.register(Feeding)
|
|
|
|
class FeedingAdmin(admin.ModelAdmin):
|
2017-08-13 16:51:01 +00:00
|
|
|
list_display = ('start', 'end', 'duration', 'baby', 'type', 'method',)
|
2017-08-13 19:05:44 +00:00
|
|
|
search_fields = ('baby__first_name', 'baby__last_name', 'type', 'method',)
|
2017-08-13 15:59:14 +00:00
|
|
|
|
|
|
|
|
2017-08-13 14:48:16 +00:00
|
|
|
@admin.register(Sleep)
|
|
|
|
class SleepAdmin(admin.ModelAdmin):
|
2017-08-13 16:51:01 +00:00
|
|
|
list_display = ('start', 'end', 'duration', 'baby',)
|
2017-08-13 14:48:16 +00:00
|
|
|
search_fields = ('baby__first_name', 'baby__last_name',)
|
2017-08-13 19:05:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
@admin.register(TummyTime)
|
|
|
|
class TummyTimeAdmin(admin.ModelAdmin):
|
|
|
|
list_display = ('start', 'end', 'duration', 'baby', 'milestone',)
|
|
|
|
search_fields = ('baby__first_name', 'baby__last_name', 'milestone',)
|