mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-04 21:58:54 -05:00
undo accidental changes
This commit is contained in:
@@ -49,9 +49,7 @@ def get_active_space(self):
|
|||||||
|
|
||||||
def get_shopping_share(self):
|
def get_shopping_share(self):
|
||||||
# get list of users that shared shopping list with user. Django ORM forbids this type of query, so raw is required
|
# get list of users that shared shopping list with user. Django ORM forbids this type of query, so raw is required
|
||||||
return User.objects.raw(
|
return User.objects.raw(' '.join([
|
||||||
' '.join(
|
|
||||||
[
|
|
||||||
'SELECT auth_user.id FROM auth_user',
|
'SELECT auth_user.id FROM auth_user',
|
||||||
'INNER JOIN cookbook_userpreference',
|
'INNER JOIN cookbook_userpreference',
|
||||||
'ON (auth_user.id = cookbook_userpreference.user_id)',
|
'ON (auth_user.id = cookbook_userpreference.user_id)',
|
||||||
@@ -700,8 +698,7 @@ class Food(ExportModelOperationsMixin('food'), TreeModel, PermissionModelMixin):
|
|||||||
if len(inherit) > 0:
|
if len(inherit) > 0:
|
||||||
# ManyToMany cannot be updated through an UPDATE operation
|
# ManyToMany cannot be updated through an UPDATE operation
|
||||||
for i in inherit:
|
for i in inherit:
|
||||||
trough.objects.bulk_create(
|
trough.objects.bulk_create([
|
||||||
[
|
|
||||||
trough(food_id=x, foodinheritfield_id=i['id'])
|
trough(food_id=x, foodinheritfield_id=i['id'])
|
||||||
for x in Food.objects.filter(tree_filter).values_list('id', flat=True)
|
for x in Food.objects.filter(tree_filter).values_list('id', flat=True)
|
||||||
])
|
])
|
||||||
@@ -831,8 +828,7 @@ class PropertyType(models.Model, PermissionModelMixin):
|
|||||||
unit = models.CharField(max_length=64, blank=True, null=True)
|
unit = models.CharField(max_length=64, blank=True, null=True)
|
||||||
order = models.IntegerField(default=0)
|
order = models.IntegerField(default=0)
|
||||||
description = models.CharField(max_length=512, blank=True, null=True)
|
description = models.CharField(max_length=512, blank=True, null=True)
|
||||||
category = models.CharField(
|
category = models.CharField(max_length=64, choices=((NUTRITION, _('Nutrition')), (ALLERGEN, _('Allergen')),
|
||||||
max_length=64, choices=((NUTRITION, _('Nutrition')), (ALLERGEN, _('Allergen')),
|
|
||||||
(PRICE, _('Price')), (GOAL, _('Goal')), (OTHER, _('Other'))), null=True, blank=True)
|
(PRICE, _('Price')), (GOAL, _('Goal')), (OTHER, _('Other'))), null=True, blank=True)
|
||||||
open_data_slug = models.CharField(max_length=128, null=True, blank=True, default=None)
|
open_data_slug = models.CharField(max_length=128, null=True, blank=True, default=None)
|
||||||
|
|
||||||
@@ -1396,8 +1392,7 @@ class Automation(ExportModelOperationsMixin('automations'), models.Model, Permis
|
|||||||
UNIT_REPLACE = 'UNIT_REPLACE'
|
UNIT_REPLACE = 'UNIT_REPLACE'
|
||||||
NAME_REPLACE = 'NAME_REPLACE'
|
NAME_REPLACE = 'NAME_REPLACE'
|
||||||
|
|
||||||
type = models.CharField(
|
type = models.CharField(max_length=128,
|
||||||
max_length=128,
|
|
||||||
choices=(
|
choices=(
|
||||||
(FOOD_ALIAS, _('Food Alias')),
|
(FOOD_ALIAS, _('Food Alias')),
|
||||||
(UNIT_ALIAS, _('Unit Alias')),
|
(UNIT_ALIAS, _('Unit Alias')),
|
||||||
|
|||||||
Reference in New Issue
Block a user