mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-01 04:10:06 -05:00
nothing working yet
This commit is contained in:
@@ -9,10 +9,10 @@ from django.utils.translation import gettext as _
|
||||
from rest_framework import viewsets, permissions
|
||||
|
||||
from cookbook.helper.permission_helper import group_required
|
||||
from cookbook.models import Recipe, Sync, Storage, CookLog, MealPlan
|
||||
from cookbook.models import Recipe, Sync, Storage, CookLog, MealPlan, MealType
|
||||
from cookbook.provider.dropbox import Dropbox
|
||||
from cookbook.provider.nextcloud import Nextcloud
|
||||
from cookbook.serializer import MealPlanSerializer
|
||||
from cookbook.serializer import MealPlanSerializer, MealTypeSerializer
|
||||
|
||||
|
||||
class MealPlanViewSet(viewsets.ModelViewSet):
|
||||
@@ -28,6 +28,12 @@ class MealPlanViewSet(viewsets.ModelViewSet):
|
||||
return queryset
|
||||
|
||||
|
||||
class MealTypeViewSet(viewsets.ModelViewSet):
|
||||
queryset = MealType.objects.all()
|
||||
serializer_class = MealTypeSerializer
|
||||
permission_classes = [permissions.IsAuthenticated]
|
||||
|
||||
|
||||
def get_recipe_provider(recipe):
|
||||
if recipe.storage.method == Storage.DROPBOX:
|
||||
return Dropbox
|
||||
|
||||
Reference in New Issue
Block a user