Commit 1fc4d249 authored by Jonathan Talbot's avatar Jonathan Talbot

fix

parent 4b934cfd
No preview for this file type
# Generated by Django 4.0.3 on 2022-04-08 06:12
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('widget_group3', '0002_alter_widgetuser_first_name'),
]
operations = [
migrations.AlterField(
model_name='widgetuser',
name='id_num',
field=models.CharField(max_length=7, validators=[django.core.validators.RegexValidator('^\\d{1,10}$')]),
),
]
from django.db import models from django.db import models
from django.urls import reverse from django.urls import reverse
from django.core.validators import RegexValidator
# Department used for widget user # Department used for widget user
class Department(models.Model): class Department(models.Model):
...@@ -10,7 +11,7 @@ class Department(models.Model): ...@@ -10,7 +11,7 @@ class Department(models.Model):
return '{}, {}'.format(self.dept_name, self.home_unit) return '{}, {}'.format(self.dept_name, self.home_unit)
class WidgetUser(models.Model): class WidgetUser(models.Model):
id_num = models.IntegerField() id_num = models.CharField(max_length=7, validators=[RegexValidator(r'^\d{1,10}$')])
first_name = models.CharField(max_length=90) first_name = models.CharField(max_length=90)
middle_name = models.CharField(max_length=100) middle_name = models.CharField(max_length=100)
last_name = models.CharField(max_length=100) last_name = models.CharField(max_length=100)
......
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