edited the WidgetUser model in order to link a user to a department object(home department name)

parent 87d70290
# Generated by Django 4.1.7 on 2023-03-05 04:52 # Generated by Django 4.1.7 on 2023-03-05 08:41
from django.db import migrations, models from django.db import migrations, models
......
# Generated by Django 4.1.7 on 2023-03-05 08:42
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("dashboard", "0001_initial"),
]
operations = [
migrations.AlterField(
model_name="widgetuser",
name="department",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to="dashboard.department"
),
),
]
...@@ -15,7 +15,8 @@ class WidgetUser(models.Model): ...@@ -15,7 +15,8 @@ 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)
department = models.CharField(max_length = 50) department = models.ForeignKey(Department, on_delete = models.CASCADE)
def __str__(self): def __str__(self):
username = self.first_name + " " + self.middle_name + " " + self.last_name username = self.first_name + " " + self.middle_name + " " + self.last_name
......
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