Commit f1f4d8d5 authored by Pierre Ashley Salcedo's avatar Pierre Ashley Salcedo

fix: fixed new fields from new updates, migrated changes, and populated fields

parent 04c70aa6
# Generated by Django 3.2.12 on 2022-04-06 21:05
import django.core.validators
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=64)),
],
),
migrations.AddField(
model_name='widgetuser',
name='email',
field=models.EmailField(default=None, max_length=320, null=True),
),
migrations.AddField(
model_name='widgetuser',
name='id_num',
field=models.PositiveIntegerField(default=None, null=True, validators=[django.core.validators.MaxValueValidator(9999999)]),
),
migrations.AddField(
model_name='widgetuser',
name='department',
field=models.ForeignKey(default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to='homepage.department'),
),
]
from django.db import models from django.db import models
from django.core.validators import MaxValueValidator
# Create your models here. # Create your models here.
class Department(models.Model): class Department(models.Model):
...@@ -15,8 +16,16 @@ class WidgetUser(models.Model): ...@@ -15,8 +16,16 @@ class WidgetUser(models.Model):
first_name = models.CharField(max_length=50) first_name = models.CharField(max_length=50)
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.PositiveIntegerField(max_length=7) id_num = models.PositiveIntegerField(
email = models.CharField(max_length=320) validators=[MaxValueValidator(9999999)],
default=None,
null=True
)
email = models.EmailField(
max_length=320,
default=None,
null=True
)
department = models.ForeignKey( department = models.ForeignKey(
Department, Department,
on_delete=models.CASCADE, on_delete=models.CASCADE,
......
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