generated from 2martens/django-template
Added constraints to many to many tables
This commit is contained in:
@ -122,6 +122,7 @@ class UsedKitchenUtility(models.Model):
|
||||
default=1)
|
||||
|
||||
class Meta:
|
||||
unique_together = ['recipe', 'kitchen_utility']
|
||||
verbose_name = _('Used kitchen utility')
|
||||
verbose_name_plural = _('Used kitchen utilities')
|
||||
|
||||
@ -134,6 +135,7 @@ class UsedIngredient(models.Model):
|
||||
unit = models.CharField(_('Unit for amount'), max_length=10, choices=MEASUREMENT_UNITS)
|
||||
|
||||
class Meta:
|
||||
unique_together = ['recipe', 'ingredient']
|
||||
verbose_name = _('Used ingredient')
|
||||
verbose_name_plural = _('Used ingredients')
|
||||
|
||||
@ -190,6 +192,7 @@ class StoredIngredient(models.Model):
|
||||
choices=MEASUREMENT_UNITS)
|
||||
|
||||
class Meta:
|
||||
unique_together = ['pantry', 'ingredient']
|
||||
verbose_name = _('Stored ingredient')
|
||||
verbose_name_plural = _('Stored ingredients')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user