Verified Commit cf78b624 authored by Jonathan Weth's avatar Jonathan Weth

Make model Mensa extensible

parent 30a00aa3
# Generated by Django 3.0.3 on 2020-02-25 15:40
import django.contrib.postgres.fields.jsonb
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('mensa', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='menu',
name='extended_data',
field=django.contrib.postgres.fields.jsonb.JSONField(default=dict, editable=False),
),
]
from django.db import models
# Create your models here.
from aleksis.core.mixins import ExtensibleModel
from aleksis.core.util.core_helpers import path_and_rename
from django.utils.translation import gettext_lazy as _
......@@ -9,7 +10,7 @@ def path_and_rename_menu(instance, filename: str) -> str:
return path_and_rename(instance, filename, upload_to="menu")
class Menu(models.Model):
class Menu(ExtensibleModel):
calendar_week = models.IntegerField(verbose_name=_("CW"))
year = models.IntegerField(verbose_name=_("Year"))
pdf = models.FileField(upload_to=path_and_rename_menu, verbose_name=_("PDF"))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment