Commit 714224ab authored by KaoruSawade's avatar KaoruSawade

Made models for Dashboard app: Department and WidgetUser

parent 5414b139
from django.db import models from django.db import models
# Create your models here. # Create your models here.
class Department(models.Model):
dept_name = models.CharField(max_length=300)
home_unit = models.CharField(max_length=300)
def __str__(self):
return self.dept_name
class WidgetUser(models.Model):
first_name = models.CharField(max_length=300)
middle_name = models.CharField(max_length=300)
last_name = models.CharField(max_length=300)
department = models.ForeignKey(Department, on_delete=models.CASCADE)
def __str__(self):
return '{} {} {}'.format(self.first_name, self.middle_name, self.last_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