Made meal plan name unique per author

This commit is contained in:
2020-02-23 15:39:16 +01:00
parent 2326d590f9
commit 6ee50c683c
2 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,19 @@
# Generated by Django 3.0.3 on 2020-02-23 14:38
from django.conf import settings
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('food_planner', '0007_mealplan_name'),
]
operations = [
migrations.AlterUniqueTogether(
name='mealplan',
unique_together={('author', 'name')},
),
]

View File

@ -306,3 +306,4 @@ class MealPlan(models.Model):
class Meta:
verbose_name = _('Meal plan')
verbose_name_plural = _('Meal plans')
unique_together = ['author', 'name']