Fix after rebase
This commit is contained in:
@ -30,9 +30,10 @@ def search_recipes(request, queryset, params):
|
|||||||
if search_last_viewed > 0:
|
if search_last_viewed > 0:
|
||||||
last_viewed_recipes = ViewLog.objects.filter(
|
last_viewed_recipes = ViewLog.objects.filter(
|
||||||
created_by=request.user, space=request.space,
|
created_by=request.user, space=request.space,
|
||||||
created_at__gte=datetime.now() - timedelta(days=14)).values_list(
|
created_at__gte=datetime.now() - timedelta(days=14)
|
||||||
'recipe__pk', flat=True).distinct()
|
).order_by('pk').values_list('recipe__pk', flat=True).distinct()
|
||||||
return queryset.filter(pk__in=list(set(last_viewed_recipes))[-search_last_viewed:])
|
|
||||||
|
return queryset.filter(pk__in=last_viewed_recipes[len(last_viewed_recipes) - min(len(last_viewed_recipes), search_last_viewed):])
|
||||||
|
|
||||||
queryset = queryset.annotate(
|
queryset = queryset.annotate(
|
||||||
new_recipe=Case(When(
|
new_recipe=Case(When(
|
||||||
|
@ -385,7 +385,7 @@ class NutritionInformation(models.Model, PermissionModelMixin):
|
|||||||
return f'Nutrition {self.pk}'
|
return f'Nutrition {self.pk}'
|
||||||
|
|
||||||
|
|
||||||
class Recipe(models.Model, PermissionModelMixin):
|
class Recipe(ExportModelOperationsMixin('recipe'), models.Model, PermissionModelMixin):
|
||||||
name = models.CharField(max_length=128)
|
name = models.CharField(max_length=128)
|
||||||
description = models.CharField(max_length=512, blank=True, null=True)
|
description = models.CharField(max_length=512, blank=True, null=True)
|
||||||
servings = models.IntegerField(default=1)
|
servings = models.IntegerField(default=1)
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -192,6 +192,16 @@ class SupermarketViewSet(viewsets.ModelViewSet, StandardFilterMixin):
|
|||||||
return super().get_queryset()
|
return super().get_queryset()
|
||||||
|
|
||||||
|
|
||||||
|
class SupermarketCategoryViewSet(viewsets.ModelViewSet, StandardFilterMixin):
|
||||||
|
queryset = SupermarketCategory.objects
|
||||||
|
serializer_class = SupermarketCategorySerializer
|
||||||
|
permission_classes = [CustomIsUser]
|
||||||
|
|
||||||
|
def get_queryset(self):
|
||||||
|
self.queryset = self.queryset.filter(space=self.request.space)
|
||||||
|
return super().get_queryset()
|
||||||
|
|
||||||
|
|
||||||
class KeywordViewSet(viewsets.ModelViewSet, FuzzyFilterMixin):
|
class KeywordViewSet(viewsets.ModelViewSet, FuzzyFilterMixin):
|
||||||
"""
|
"""
|
||||||
list:
|
list:
|
||||||
|
@ -34,7 +34,6 @@ from cookbook.models import (Comment, CookLog, InviteLink, MealPlan,
|
|||||||
from cookbook.tables import (CookLogTable, RecipeTable, RecipeTableSmall,
|
from cookbook.tables import (CookLogTable, RecipeTable, RecipeTableSmall,
|
||||||
ViewLogTable, InviteLinkTable)
|
ViewLogTable, InviteLinkTable)
|
||||||
from cookbook.views.data import Object
|
from cookbook.views.data import Object
|
||||||
from recipes.settings import DEMO
|
|
||||||
from recipes.version import BUILD_REF, VERSION_NUMBER
|
from recipes.version import BUILD_REF, VERSION_NUMBER
|
||||||
|
|
||||||
|
|
||||||
|
31333
vue/package-lock.json
generated
Normal file
31333
vue/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -1 +1 @@
|
|||||||
{"status":"done","chunks":{"recipe_search_view":["css/chunk-vendors.css","js/chunk-vendors.js","js/recipe_search_view.js"],"recipe_view":["css/chunk-vendors.css","js/chunk-vendors.js","js/recipe_view.js"],"offline_view":["css/chunk-vendors.css","js/chunk-vendors.js","js/offline_view.js"],"import_response_view":["css/chunk-vendors.css","js/chunk-vendors.js","js/import_response_view.js"]},"assets":{"../../templates/sw.js":{"name":"../../templates/sw.js","path":"../../templates/sw.js"},"css/chunk-vendors.css":{"name":"css/chunk-vendors.css","path":"css/chunk-vendors.css"},"js/chunk-vendors.js":{"name":"js/chunk-vendors.js","path":"js/chunk-vendors.js"},"js/import_response_view.js":{"name":"js/import_response_view.js","path":"js/import_response_view.js"},"js/offline_view.js":{"name":"js/offline_view.js","path":"js/offline_view.js"},"js/recipe_search_view.js":{"name":"js/recipe_search_view.js","path":"js/recipe_search_view.js"},"js/recipe_view.js":{"name":"js/recipe_view.js","path":"js/recipe_view.js"},"recipe_search_view.html":{"name":"recipe_search_view.html","path":"recipe_search_view.html"},"recipe_view.html":{"name":"recipe_view.html","path":"recipe_view.html"},"offline_view.html":{"name":"offline_view.html","path":"offline_view.html"},"import_response_view.html":{"name":"import_response_view.html","path":"import_response_view.html"},"manifest.json":{"name":"manifest.json","path":"manifest.json"}}}
|
{"status":"done","chunks":{"recipe_search_view":["css/chunk-vendors.css","js/chunk-vendors.js","js/recipe_search_view.js"],"recipe_view":["css/chunk-vendors.css","js/chunk-vendors.js","js/recipe_view.js"],"offline_view":["css/chunk-vendors.css","js/chunk-vendors.js","js/offline_view.js"],"import_response_view":["css/chunk-vendors.css","js/chunk-vendors.js","js/import_response_view.js"],"supermarket_view":["css/chunk-vendors.css","js/chunk-vendors.js","js/supermarket_view.js"]},"assets":{"../../templates/sw.js":{"name":"../../templates/sw.js","path":"../../templates/sw.js"},"css/chunk-vendors.css":{"name":"css/chunk-vendors.css","path":"css/chunk-vendors.css"},"js/chunk-vendors.js":{"name":"js/chunk-vendors.js","path":"js/chunk-vendors.js"},"js/import_response_view.js":{"name":"js/import_response_view.js","path":"js/import_response_view.js"},"js/offline_view.js":{"name":"js/offline_view.js","path":"js/offline_view.js"},"js/recipe_search_view.js":{"name":"js/recipe_search_view.js","path":"js/recipe_search_view.js"},"js/recipe_view.js":{"name":"js/recipe_view.js","path":"js/recipe_view.js"},"js/supermarket_view.js":{"name":"js/supermarket_view.js","path":"js/supermarket_view.js"},"recipe_search_view.html":{"name":"recipe_search_view.html","path":"recipe_search_view.html"},"recipe_view.html":{"name":"recipe_view.html","path":"recipe_view.html"},"offline_view.html":{"name":"offline_view.html","path":"offline_view.html"},"import_response_view.html":{"name":"import_response_view.html","path":"import_response_view.html"},"supermarket_view.html":{"name":"supermarket_view.html","path":"supermarket_view.html"},"manifest.json":{"name":"manifest.json","path":"manifest.json"}}}
|
15550
vue/yarn.lock
15550
vue/yarn.lock
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user