Commit a9decd4e authored by Anya Habana's avatar Anya Habana

Created migrations for homepage models

parent becf25c5
# Generated by Django 3.2.12 on 2022-04-04 10:25
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('homepage', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Department',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('dept_name', models.CharField(max_length=100)),
('home_unit', models.CharField(max_length=100)),
],
),
migrations.AddField(
model_name='widgetuser',
name='email',
field=models.EmailField(default='', max_length=254),
),
migrations.AddField(
model_name='widgetuser',
name='id_num',
field=models.CharField(default='', max_length=7),
),
migrations.AddField(
model_name='widgetuser',
name='department',
field=models.ForeignKey(default='', on_delete=django.db.models.deletion.CASCADE, related_name='users', to='homepage.department'),
),
]
...@@ -9,6 +9,6 @@ class WidgetUser(models.Model): ...@@ -9,6 +9,6 @@ class WidgetUser(models.Model):
first_name = models.CharField(max_length=100) first_name = models.CharField(max_length=100)
middle_name = models.CharField(max_length=50) middle_name = models.CharField(max_length=50)
last_name = models.CharField(max_length=50) last_name = models.CharField(max_length=50)
id_num = models.CharField(max_length=7) id_num = models.CharField(max_length=7, default="")
email = models.EmailField() email = models.EmailField(default="")
department = models.ForeignKey(Department, on_delete=models.CASCADE, related_name="users") department = models.ForeignKey(Department, on_delete=models.CASCADE, related_name="users", default="")
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