Added default values for fields in WidgetUser class in homepage.models, and...

Added default values for fields in WidgetUser class in homepage.models, and edited Department class of homepage.models
parent 5f95b72b
...@@ -2,9 +2,19 @@ from django.db import models ...@@ -2,9 +2,19 @@ from django.db import models
# Create your models here. # Create your models here.
class WidgetUser(models.Model): class WidgetUser(models.Model):
first_name = models.CharField(max_length=50) first_name = models.CharField(max_length=50, default='first_name')
middle_name = models.CharField(max_length=50) middle_name = models.CharField(max_length=50, default='middle_name')
last_name = models.CharField(max_length=50) last_name = models.CharField(max_length=50, default='last_name')
id_name = models.CharField(max_length=7, default='1234567')
email = models.CharField(max_length=50, default='someemail@gmail.com')
def __str__(self): def __str__(self):
return self.last_name return self.last_name
class Department(models.Model):
widgetuser = models.ForeignKey(WidgetUser, on_delete=models.CASCADE)
dept_name = models.CharField(max_length=50)
home_unit = models.CharField(max_length=50)
def __str__(self):
return self.dept_name
\ No newline at end of file
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