23 lines
794 B
Python
23 lines
794 B
Python
# admin.py
|
|
from django.contrib import admin
|
|
from .models import Feeding, Potty
|
|
|
|
|
|
|
|
class PottyAdmin(admin.ModelAdmin):
|
|
# Show timestamp in the list view
|
|
list_display = ('timestamp', 'consistency', 'notes') # Add timestamp here
|
|
|
|
# Allow timestamp to be editable in the form view
|
|
fields = ('consistency', 'notes') # Add timestamp here to the edit form
|
|
|
|
admin.site.register(Potty, PottyAdmin)
|
|
|
|
class FeedingAdmin(admin.ModelAdmin):
|
|
# Show timestamp in the list view
|
|
list_display = ('timestamp', 'feeding_type', 'amount', 'duration' , 'notes') # Add timestamp here
|
|
|
|
# Allow timestamp to be editable in the form view
|
|
fields = ('feeding_type', 'amount', 'duration' , 'notes') # Add timestamp here to the edit form
|
|
|
|
admin.site.register(Feeding, FeedingAdmin) |