Test: tested homepage widget user links

parent 5edb31c7
...@@ -18,6 +18,6 @@ class Migration(migrations.Migration): ...@@ -18,6 +18,6 @@ class Migration(migrations.Migration):
migrations.AddField( migrations.AddField(
model_name='widgetuser', model_name='widgetuser',
name='department', name='department',
field=models.ForeignKey(default='default', on_delete=django.db.models.deletion.CASCADE, to='homepage.department'), field=models.ForeignKey(default='', on_delete=django.db.models.deletion.CASCADE, to='homepage.department'),
), ),
] ]
...@@ -18,7 +18,7 @@ class Migration(migrations.Migration): ...@@ -18,7 +18,7 @@ class Migration(migrations.Migration):
migrations.AddField( migrations.AddField(
model_name='department', model_name='department',
name='widgetuser', name='widgetuser',
field=models.ForeignKey(default='none', on_delete=django.db.models.deletion.CASCADE, to='homepage.widgetuser'), field=models.ForeignKey(default=2, on_delete=django.db.models.deletion.CASCADE, to='homepage.widgetuser'),
), ),
migrations.AlterField( migrations.AlterField(
model_name='department', model_name='department',
......
# Generated by Django 3.2.12 on 2022-05-14 15:12
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('homepage', '0005_auto_20220514_1530'),
]
operations = [
migrations.AddField(
model_name='widgetuser',
name='face_img',
field=models.ImageField(default='none', upload_to='uploads/'),
),
]
# Generated by Django 3.2.12 on 2022-05-14 15:15
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('homepage', '0006_widgetuser_face_img'),
]
operations = [
migrations.AlterField(
model_name='widgetuser',
name='face_img',
field=models.ImageField(default='none', upload_to=''),
),
]
# Generated by Django 3.2.12 on 2022-05-14 15:24
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('homepage', '0007_alter_widgetuser_face_img'),
]
operations = [
migrations.RemoveField(
model_name='widgetuser',
name='face_img',
),
]
# Generated by Django 3.2.12 on 2022-05-14 15:26
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('homepage', '0008_remove_widgetuser_face_img'),
]
operations = [
migrations.AlterField(
model_name='department',
name='widgetuser',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='homepage.widgetuser'),
),
]
# Generated by Django 3.2.12 on 2022-05-14 16:50
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('homepage', '0009_alter_department_widgetuser'),
]
operations = [
migrations.AlterField(
model_name='department',
name='dept_name',
field=models.CharField(max_length=50),
),
migrations.AlterField(
model_name='department',
name='home_unit',
field=models.CharField(max_length=50),
),
]
# Generated by Django 3.2.12 on 2022-05-14 16:51
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('homepage', '0010_auto_20220514_1950'),
]
operations = [
migrations.AlterField(
model_name='department',
name='widgetuser',
field=models.ForeignKey(default='', on_delete=django.db.models.deletion.CASCADE, to='homepage.widgetuser'),
),
]
# Generated by Django 3.2.12 on 2022-05-14 16:52
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('homepage', '0011_alter_department_widgetuser'),
]
operations = [
migrations.AlterField(
model_name='department',
name='widgetuser',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='homepage.widgetuser'),
),
]
# Generated by Django 3.2.12 on 2022-05-14 17:14
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('homepage', '0012_alter_department_widgetuser'),
]
operations = [
migrations.AlterField(
model_name='department',
name='widgetuser',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='homepage.widgetuser'),
),
]
# Generated by Django 3.2.12 on 2022-05-14 17:19
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('homepage', '0013_alter_department_widgetuser'),
]
operations = [
migrations.AlterField(
model_name='department',
name='widgetuser',
field=models.ForeignKey(default='', on_delete=django.db.models.deletion.CASCADE, to='homepage.widgetuser'),
),
]
# Generated by Django 3.2.12 on 2022-05-14 17:20
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('homepage', '0014_alter_department_widgetuser'),
]
operations = [
migrations.AlterField(
model_name='department',
name='widgetuser',
field=models.ForeignKey(default='', on_delete=django.db.models.deletion.CASCADE, to='homepage.widgetuser'),
),
]
# Generated by Django 3.2.12 on 2022-05-14 17:25
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('homepage', '0015_alter_department_widgetuser'),
]
operations = [
migrations.AlterField(
model_name='department',
name='widgetuser',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='homepage.widgetuser'),
),
]
# Generated by Django 3.2.12 on 2022-05-14 17:43
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('homepage', '0016_alter_department_widgetuser'),
]
operations = [
migrations.AlterField(
model_name='department',
name='widgetuser',
field=models.ForeignKey(default=2, on_delete=django.db.models.deletion.CASCADE, to='homepage.widgetuser'),
),
]
from email.policy import default
from django.db import models from django.db import models
# Create your models here. # Create your models here.
...@@ -12,9 +13,9 @@ class WidgetUser(models.Model): ...@@ -12,9 +13,9 @@ class WidgetUser(models.Model):
return self.last_name return self.last_name
class Department(models.Model): class Department(models.Model):
widgetuser = models.ForeignKey(WidgetUser, on_delete=models.CASCADE, default='none') widgetuser = models.ForeignKey(WidgetUser, on_delete=models.CASCADE, null=False, default = 2)
dept_name = models.CharField(max_length=50, default='none') dept_name = models.CharField(max_length=50)
home_unit = models.CharField(max_length=50, default='none') home_unit = models.CharField(max_length=50)
def __str__(self): def __str__(self):
return self.dept_name 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