Skip to content
Snippets Groups Projects
Commit 2ef81c5e authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Add unique index to menu

parent a44d945b
No related branches found
No related tags found
1 merge request!86Merge school-apps
# Generated by Django 2.0.7 on 2018-12-11 15:48
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('mealplan', '0003_auto_20181129_1747'),
]
operations = [
migrations.AlterUniqueTogether(
name='mealplan',
unique_together={('calendar_week', 'year')},
),
]
......@@ -5,9 +5,14 @@ from helper import path_and_rename
class MealPlan(models.Model):
calendar_week = models.IntegerField()
year = models.IntegerField()
pdf = models.FileField(upload_to=path_and_rename)
calendar_week = models.IntegerField(verbose_name="KW")
year = models.IntegerField(verbose_name="Jahr")
pdf = models.FileField(upload_to=path_and_rename, verbose_name="PDF")
class Meta:
unique_together = ("calendar_week", "year")
verbose_name = "Speiseplan"
verbose_name_plural = "Speisepläne"
def __str__(self):
return "KW {}/{}".format(self.calendar_week, self.year)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment