Commit 8cd885bd authored by Vaughn Fajardo's avatar Vaughn Fajardo

fix: changed method for max value of id num for homepage

parent 454eb6c4
# Generated by Django 4.0.3 on 2022-04-05 11:02
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('homepage', '0006_alter_widgetuser_department'),
]
operations = [
migrations.AlterField(
model_name='widgetuser',
name='id_num',
field=models.IntegerField(null=True, validators=[django.core.validators.MaxValueValidator(9999999)]),
),
]
from django.db import models from django.db import models
from django.core.validators import MaxValueValidator
class Department(models.Model): class Department(models.Model):
dept_name = models.CharField(max_length=50, null=True) dept_name = models.CharField(max_length=50, null=True)
...@@ -11,7 +12,7 @@ class WidgetUser(models.Model): ...@@ -11,7 +12,7 @@ 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.IntegerField(max_length=7, null=True) id_num = models.IntegerField(validators=[MaxValueValidator(9999999)], null=True)
email = models.EmailField(max_length=50, null=True) email = models.EmailField(max_length=50, null=True)
department = models.ForeignKey(Department, department = models.ForeignKey(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