A Django app providing ingredient handling.
Project description
Quick start
Add “dj_ingredient_field” to your INSTALLED_APPS setting like this:
INSTALLED_APPS = [ ... 'dj_ingredient_field', ]
To use lazy loaded widgets include this module in your urlpatterns:
urlpatterns = [ path('cooking/', include('dj_ingredient_field.urls')), ... ]
That’s it!
Usage
Simply add the fields you need to your model:
from dj_ingredient_field import IngredientField, MeasurementUnitField class MyModel(models.Model): ingredient = IngredientField() unit = MeasurementUnitField()
The fields map to Ingredient and MeasurementUnit classes:
from dj_ingredient_field import IngredientName, Ingredient, MeasurementUnit, INGREDIENT_UNITS model.ingredient = Ingredient(IngredientName.I_ARUGULA) model.unit = MeasurementUnit(**INGREDIENT_UNITS["Killogram"])
All the available ingredients can be found in the IngredientName enum
Ingredients and units can be customized, see ‘Settings’
Documentation
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for django-ingredient-field-1.3.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac23d0a9a3151dbdea79f5eea1d83ad3cf7c1dc043c7002bed780d1a1320bba1 |
|
MD5 | 06ab4b4e4e5fc15bdaf827739f29e1e3 |
|
BLAKE2b-256 | 24d89cc854266af2652d7ad362bc582a9481678be3c5407336555d711fb320a6 |