- Add openfoodfacts Python SDK dependency - Create foods/sources/openfoodfacts.py API wrapper with text_search - Add off_code field + find_or_create_from_search() to Food model - Add nutrition fields (protein, fat, carbs, fiber, sugar, sodium), ingredients, image, off_code to Drink model - Create FoodSearchView and FoodScrobbleFromSearchView at /foods/search/ - Route beverages to Drink model based on OFF category keywords - Update ManualScrobbleView to redirect '-f Food Name' to food search - Add Drinks section to home page and scrobble detail templates - Update drink_detail.html with nutrition grid and image display
21 lines
505 B
Python
21 lines
505 B
Python
from django.urls import path
|
|
from foods import views
|
|
|
|
app_name = "foods"
|
|
|
|
|
|
urlpatterns = [
|
|
path("foods/", views.FoodListView.as_view(), name="food_list"),
|
|
path("foods/search/", views.FoodSearchView.as_view(), name="food_search"),
|
|
path(
|
|
"foods/scrobble-from-search/",
|
|
views.FoodScrobbleFromSearchView.as_view(),
|
|
name="food_scrobble_from_search",
|
|
),
|
|
path(
|
|
"foods/<slug:slug>/",
|
|
views.FoodDetailView.as_view(),
|
|
name="food_detail",
|
|
),
|
|
]
|