Enhancements

This commit is contained in:
Joren de Graaf
2026-10-11 20:46:55 +02:00
parent cb12c23732
commit 000ec834b0
26 changed files with 813 additions and 30 deletions
+10
View File
@@ -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'}))