1
0
mirror of https://github.com/ae-utbm/sith.git synced 2025-07-19 16:29:23 +00:00
Files
.github
antispam
club
migrations
0001_initial.py
0002_auto_20160824_2152.py
0003_auto_20160902_2042.py
0004_auto_20160915_1057.py
0005_auto_20161120_1149.py
0006_auto_20161229_0040.py
0007_auto_20170324_0917.py
0008_auto_20170515_2214.py
0009_auto_20170822_2232.py
0010_auto_20170912_2028.py
0010_club_logo.py
0011_auto_20180426_2013.py
0012_club_board_group_club_members_group.py
0013_alter_club_board_group_alter_club_members_group_and_more.py
0014_alter_club_options_rename_unix_name_club_slug_name_and_more.py
__init__.py
static
templates
tests
widgets
__init__.py
admin.py
api.py
forms.py
models.py
schemas.py
urls.py
views.py
com
core
counter
docs
eboutic
election
forum
galaxy
locale
matmat
pedagogy
rootplace
sas
sith
staticfiles
subscription
trombi
.coveragerc
.env.example
.envrc
.gitattributes
.gitignore
.mailmap
.npmrc
.pre-commit-config.yaml
.python-version
CONTRIBUTING.rst
LICENSE
Procfile.service
Procfile.static
README.md
biome.json
conftest.py
manage.py
mkdocs.yml
openapi-csrf.ts
openapi-ts.config.ts
package-lock.json
package.json
pyproject.toml
tsconfig.json
uv.lock
vite.config.mts
Sith/club/migrations/0001_initial.py
2024-07-08 15:37:09 +02:00

101 lines
3.4 KiB
Python

from __future__ import unicode_literals
import django.core.validators
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = []
operations = [
migrations.CreateModel(
name="Club",
fields=[
(
"id",
models.AutoField(
primary_key=True,
serialize=False,
verbose_name="ID",
auto_created=True,
),
),
("name", models.CharField(max_length=64, verbose_name="name")),
(
"unix_name",
models.CharField(
unique=True,
max_length=30,
error_messages={
"unique": "A club with that unix name already exists."
},
verbose_name="unix name",
validators=[
django.core.validators.RegexValidator(
"^[a-z0-9][a-z0-9._-]*[a-z0-9]$",
"Enter a valid unix name. This value may contain only letters, numbers ./-/_ characters.",
)
],
),
),
("address", models.CharField(max_length=254, verbose_name="address")),
],
),
migrations.CreateModel(
name="Membership",
fields=[
(
"id",
models.AutoField(
primary_key=True,
serialize=False,
verbose_name="ID",
auto_created=True,
),
),
(
"start_date",
models.DateField(verbose_name="start date", auto_now=True),
),
(
"end_date",
models.DateField(null=True, verbose_name="end date", blank=True),
),
(
"role",
models.IntegerField(
choices=[
(0, "Curious"),
(1, "Active member"),
(2, "Board member"),
(3, "IT supervisor"),
(4, "Secretary"),
(5, "Communication supervisor"),
(7, "Treasurer"),
(9, "Vice-President"),
(10, "President"),
],
default=0,
verbose_name="role",
),
),
(
"description",
models.CharField(
max_length=128, blank=True, verbose_name="description"
),
),
(
"club",
models.ForeignKey(
verbose_name="club",
to="club.Club",
related_name="members",
on_delete=django.db.models.deletion.CASCADE,
),
),
],
),
]