Made meal plan name unique per author

master
Jim Martens 2 years ago
parent 2326d590f9
commit 6ee50c683c
  1. 19
      food_planner/migrations/0008_auto_20200223_1538.py
  2. 1
      food_planner/models.py

@ -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')},
),
]

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

Loading…
Cancel
Save