38 lines
1.2 KiB
Python
38 lines
1.2 KiB
Python
from django import forms
|
|
from .models import Feeding, Potty
|
|
|
|
class FeedingForm(forms.ModelForm):
|
|
class Meta:
|
|
model = Feeding
|
|
fields = ['feeding_type', 'amount', 'duration', 'notes']
|
|
widgets = {
|
|
'feeding_type': forms.Select(attrs={'class': 'form-control'}),
|
|
'amount': forms.NumberInput(attrs={
|
|
'class': 'form-control',
|
|
'placeholder': 'Enter amount (if bottle) in ounces'
|
|
}),
|
|
'duration': forms.TextInput(attrs={
|
|
'class': 'form-control',
|
|
'placeholder': 'Enter duration (if breast) in minutes'
|
|
}),
|
|
'notes': forms.Textarea(attrs={
|
|
'class': 'form-control',
|
|
'placeholder': 'Additional notes (optional)',
|
|
'rows': 3
|
|
}),
|
|
}
|
|
|
|
class PottyForm(forms.ModelForm):
|
|
class Meta:
|
|
model = Potty
|
|
fields = ['consistency', 'notes']
|
|
widgets = {
|
|
'consistency': forms.Select(attrs={'class': 'form-control'}),
|
|
'notes': forms.Textarea(attrs={
|
|
'class': 'form-control',
|
|
'placeholder': 'Additional notes (optional)',
|
|
'rows': 3
|
|
})
|
|
}
|
|
|