Skip to content
Snippets Groups Projects
Unverified Commit 6b6fe963 authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Add model for school information. Advances #19.

parent 7aa775c9
No related branches found
No related tags found
No related merge requests found
# Generated by Django 2.2.3 on 2019-07-28 20:19
# Manually edited to create default school
from django.db import migrations, models
from django.utils.translation import ugettext_lazy as _
def create_default_school(apps, schema_editor):
db_alias = schema_editor.connection.alias
School = apps.get_model('core', 'School') # noqa
School.objects.using(db_alias).create(name=_('Default school'))
class Migration(migrations.Migration):
dependencies = [
('core', '0006_make_unique'),
]
operations = [
migrations.CreateModel(
name='School',
fields=[
('id', models.AutoField(auto_created=True,
primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=30, verbose_name='Name')),
('name_official', models.CharField(
help_text='Official name of the school, e.g. as given by supervisory authority', max_length=200, verbose_name='Official name')),
],
),
migrations.RunPython(create_default_school)
]
......@@ -4,6 +4,12 @@ from django.utils.translation import gettext_lazy as _
from phonenumber_field.modelfields import PhoneNumberField
class School(models.Model):
name = models.CharField(verbose_name=_('Name'), max_length=30)
name_official = models.CharField(verbose_name=('Official name'), max_length=200, help_text=_(
'Official name of the school, e.g. as given by supervisory authority'))
class Person(models.Model):
SEX_CHOICES = [
('f', _('female')),
......
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