Skip to content
Snippets Groups Projects
Verified Commit db7a47aa authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Use ExtensibleModel on all data models and add to initial migration

Closes #167.
parent f437df45
No related branches found
No related tags found
No related merge requests found
Pipeline #732 failed
......@@ -2,6 +2,7 @@
import aleksis.core.mixins
from django.conf import settings
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
import image_cropping.fields
......@@ -22,6 +23,7 @@ class Migration(migrations.Migration):
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=60, unique=True, verbose_name='Long name of group')),
('short_name', models.CharField(max_length=16, unique=True, verbose_name='Short name of group')),
('extended_data', django.contrib.postgres.fields.jsonb.JSONField(default=dict, editable=False)),
],
options={
'ordering': ['short_name', 'name'],
......@@ -42,6 +44,7 @@ class Migration(migrations.Migration):
image_cropping.fields.ImageRatioField('logo', '600x600', adapt_rotation=False, allow_fullsize=False,
free_crop=False, help_text=None, hide_image_field=False,
size_warning=True, verbose_name='logo cropping')),
('extended_data', django.contrib.postgres.fields.jsonb.JSONField(default=dict, editable=False)),
],
options={
'ordering': ['name', 'name_official'],
......@@ -55,6 +58,7 @@ class Migration(migrations.Migration):
('date_start', models.DateField(null=True, verbose_name='Effective start date of term')),
('date_end', models.DateField(null=True, verbose_name='Effective end date of term')),
('current', models.NullBooleanField(default=None, unique=True)),
('extended_data', django.contrib.postgres.fields.jsonb.JSONField(default=dict, editable=False)),
],
),
migrations.CreateModel(
......@@ -94,6 +98,7 @@ class Migration(migrations.Migration):
models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='core.Group')),
('user', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL,
related_name='person', to=settings.AUTH_USER_MODEL)),
('extended_data', django.contrib.postgres.fields.jsonb.JSONField(default=dict, editable=False)),
],
options={
'ordering': ['last_name', 'first_name'],
......
# Generated by Django 3.0.2 on 2020-01-18 21:56
import django.contrib.postgres.fields.jsonb
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0007_create_admin_user'),
]
operations = [
migrations.AddField(
model_name='group',
name='extended_data',
field=django.contrib.postgres.fields.jsonb.JSONField(default=dict),
),
migrations.AddField(
model_name='person',
name='extended_data',
field=django.contrib.postgres.fields.jsonb.JSONField(default=dict),
),
]
......@@ -7,7 +7,7 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0008_extended_data'),
('core', '0007_create_admin_user'),
]
operations = [
......
......@@ -13,7 +13,7 @@ from .util.notifications import send_notification
from constance import config
class School(models.Model):
class School(ExtensibleModel):
"""A school that will have many other objects linked to it.
AlekSIS has multi-tenant support by linking all objects to a school,
and limiting all features to objects related to the same school as the
......@@ -40,7 +40,7 @@ class School(models.Model):
verbose_name_plural = _("Schools")
class SchoolTerm(models.Model):
class SchoolTerm(ExtensibleModel):
""" Information about a term (limited time frame) that data can
be linked to.
"""
......
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