Enhancements
This commit is contained in:
@@ -141,6 +141,16 @@ class FoodLogForm(forms.ModelForm):
|
||||
return data
|
||||
|
||||
|
||||
class FoodProductHydrationForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = FoodProduct
|
||||
fields = ('is_beverage', 'hydration_enabled', 'hydration_factor')
|
||||
labels = {'is_beverage': 'Count as a beverage',
|
||||
'hydration_enabled': 'Include in hydration totals',
|
||||
'hydration_factor': 'Fluid counting factor (0 to 1)'}
|
||||
widgets = {'hydration_factor': forms.NumberInput(attrs={'min': 0, 'max': 1, 'step': '.001'})}
|
||||
|
||||
|
||||
class InventoryItemForm(forms.ModelForm):
|
||||
location_name = forms.CharField(max_length=100, label='Location', widget=forms.TextInput(attrs={'list': 'inventory-locations', 'autocomplete': 'off'}))
|
||||
category_name = forms.CharField(max_length=100, required=False, label='My category', widget=forms.TextInput(attrs={'list': 'inventory-categories', 'autocomplete': 'off'}))
|
||||
|
||||
Reference in New Issue
Block a user