Finished Models for Dashboard

parent 9a5b4814
from django.db import models
class Department(models.Model):
dept_name = models.CharField(max_length=60)
home_unit = models.CharField(max_length=100)
def __str__(self):
return '{}, {}'.format(self.dept_name, self.home_unit)
class WidgetUser(models.Model):
first_name = models.CharField(max_length=20)
middle_name = models.CharField(max_length=20)
last_name = models.CharField(max_length=20)
department = models.ForeignKey(Department, null=True, on_delete=models.CASCADE)
def __str__(self):
return '{}, {} {} : {}'.format(self.last_name, self.first_name, self.middle_name, self.department)
\ 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