|
@@ -48,6 +48,7 @@ class FoodCategory(TimeStampedModel):
|
|
|
|
|
|
class Food(ScrobblableMixin):
|
|
class Food(ScrobblableMixin):
|
|
description = models.TextField(**BNULL)
|
|
description = models.TextField(**BNULL)
|
|
|
|
+ calories = models.IntegerField(**BNULL)
|
|
allrecipe_image = models.ImageField(upload_to="food/recipe/", **BNULL)
|
|
allrecipe_image = models.ImageField(upload_to="food/recipe/", **BNULL)
|
|
allrecipe_image_small = ImageSpecField(
|
|
allrecipe_image_small = ImageSpecField(
|
|
source="allrecipe_image",
|
|
source="allrecipe_image",
|
|
@@ -72,7 +73,8 @@ class Food(ScrobblableMixin):
|
|
|
|
|
|
@property
|
|
@property
|
|
def subtitle(self):
|
|
def subtitle(self):
|
|
- return self.category.name
|
|
|
|
|
|
+ if self.category:
|
|
|
|
+ return self.category.name
|
|
|
|
|
|
@property
|
|
@property
|
|
def strings(self) -> ScrobblableConstants:
|
|
def strings(self) -> ScrobblableConstants:
|