db model up and running

This commit is contained in:
Federico Justus Denkena 2023-10-04 19:21:30 +02:00
parent e74dced19b
commit 99068f64a3
Signed by: f-denkena
GPG Key ID: 28F91C66EE36F382
6 changed files with 56 additions and 0 deletions

View File

@ -0,0 +1,35 @@
# Generated by Django 4.2.5 on 2023-10-04 16:54
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('website', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Registrant',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=64)),
('mail', models.EmailField(max_length=254)),
('phone', models.CharField(max_length=21)),
('rate_reduced', models.BooleanField()),
('address', models.TextField()),
('birthdate', models.DateField()),
('gender', models.CharField(choices=[('Männlich', 'Männlich'), ('Weiblich', 'Weiblich'), ('Andere', 'Andere')], max_length=32)),
('food', models.CharField(choices=[('Vegetarisch', 'Vegetarisch'), ('Vegan', 'Vegan'), ('Glutenfrei', 'Glutenfrei')], max_length=32)),
('music', models.CharField(max_length=128)),
('cake', models.BooleanField()),
('publish_address', models.BooleanField()),
('publish_phone', models.BooleanField()),
('info', models.CharField(max_length=777)),
('message', models.TextField(verbose_name=2100)),
('timestamp', models.DateTimeField(auto_now_add=True)),
('payed', models.BooleanField()),
],
),
]

View File

@ -45,3 +45,24 @@ class ContactForm(ModelForm):
class Meta:
model = Contact
fields = ["pseudonym", "mail", "betreff", "nachricht"]
GESCHLECHTER = [("Männlich", "Männlich"), ("Weiblich","Weiblich"),("Andere","Andere")]
ERNÄHRUNG = [("Vegetarisch","Vegetarisch"),("Vegan","Vegan"),("Glutenfrei","Glutenfrei")]
class Registrant(models.Model):
name = models.CharField(max_length=64)
mail = models.EmailField()
phone = models.CharField(max_length=21)
rate_reduced = models.BooleanField()
address = models.TextField()
birthdate = models.DateField()
gender = models.CharField(max_length=32, blank=False, choices=GESCHLECHTER)
food = models.CharField(max_length=32, blank=False, choices=ERNÄHRUNG)
music = models.CharField(max_length=128)
cake = models.BooleanField()
publish_address = models.BooleanField()
publish_phone = models.BooleanField()
info = models.CharField(max_length=777)
message = models.TextField(2100)
timestamp = models.DateTimeField(auto_now_add=True)
payed = models.BooleanField()