Commit d34b8b67 authored by Hippolyte Vergnol (Hive)'s avatar Hippolyte Vergnol (Hive)

Merge branch 'master' of gitlab.utc.fr:sr04/pyprevention

parents 38f31dd4 449e4142
# Generated by Django 2.1.2 on 2018-10-22 09:14
import datetime
from django.conf import settings
import django.contrib.auth.models
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0009_alter_user_last_name_max_length'),
]
operations = [
migrations.CreateModel(
name='Doctor',
fields=[
('user_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)),
('address', models.CharField(max_length=100)),
],
options={
'verbose_name': 'user',
'verbose_name_plural': 'users',
'abstract': False,
},
bases=('auth.user',),
managers=[
('objects', django.contrib.auth.models.UserManager()),
],
),
migrations.CreateModel(
name='Patient',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('first_name', models.CharField(max_length=30)),
('last_name', models.CharField(max_length=30)),
('date_of_birth', models.DateField(default=datetime.datetime(2018, 10, 22, 9, 14, 41, 946384))),
('created_at', models.DateField(default=datetime.datetime(2018, 10, 22, 9, 14, 41, 946427))),
('doctor', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='dashboard.Doctor')),
],
),
]
from django.db import models
from datetime import datetime
from django.contrib.auth.models import User
# Create your models here.
class Doctor(User):
address = models.CharField(max_length=100)
class Patient(models.Model):
first_name = models.CharField(max_length=30)
last_name = models.CharField(max_length=30)
date_of_birth = models.DateField(default=datetime.now())
created_at = models.DateField(default=datetime.now())
doctor = models.ForeignKey(Doctor, on_delete=models.DO_NOTHING)
def __str__(self):
return self.last_name + self.first_name
......@@ -37,6 +37,7 @@ INSTALLED_APPS = [
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django_extensions',
'dashboard',
]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment