first steps for data modell
This commit is contained in:
parent
06cd9f63b5
commit
c4403bc117
|
@ -31,6 +31,7 @@ ALLOWED_HOSTS = []
|
||||||
# Application definition
|
# Application definition
|
||||||
|
|
||||||
INSTALLED_APPS = [
|
INSTALLED_APPS = [
|
||||||
|
'evapp.apps.EvappConfig',
|
||||||
'django.contrib.admin',
|
'django.contrib.admin',
|
||||||
'django.contrib.auth',
|
'django.contrib.auth',
|
||||||
'django.contrib.contenttypes',
|
'django.contrib.contenttypes',
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
# Generated by Django 3.1.4 on 2020-12-23 11:03
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
initial = True
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='Employee',
|
||||||
|
fields=[
|
||||||
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
|
('firstname', models.CharField(max_length=50, verbose_name='Vorname')),
|
||||||
|
('lastname', models.CharField(max_length=50, verbose_name='Nachname')),
|
||||||
|
('email', models.CharField(max_length=50, verbose_name='E-Mail-Adresse')),
|
||||||
|
('department', models.CharField(choices=[('PROG', 'Programme'), ('SOFT', 'Softwareentwicklung'), ('CENT', 'Central'), ('VOR', 'Vorstand')], max_length=5)),
|
||||||
|
('team', models.CharField(blank=True, max_length=20, null=True)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
]
|
|
@ -1,3 +1,13 @@
|
||||||
from django.db import models
|
from django.db import models
|
||||||
|
|
||||||
# Create your models here.
|
DEPARTMENT_CHOICES = {'PROG': 'Programme',
|
||||||
|
'SOFT': 'Softwareentwicklung',
|
||||||
|
'CENT': 'Central',
|
||||||
|
'VOR': 'Vorstand',}
|
||||||
|
|
||||||
|
class Employee(models.Model):
|
||||||
|
firstname = models.CharField(max_length=50, verbose_name="Vorname")
|
||||||
|
lastname = models.CharField(max_length=50, verbose_name="Nachname")
|
||||||
|
email = models.CharField(max_length=50, verbose_name="E-Mail-Adresse")
|
||||||
|
department = models.CharField(max_length=5, choices=DEPARTMENT_CHOICES.items())
|
||||||
|
team = models.CharField(max_length=20, null=True, blank=True)
|
||||||
|
|
Loading…
Reference in New Issue