feature/post-test-answers #24
@ -4,7 +4,6 @@
|
||||
|
||||
{% block content %}
|
||||
<h1>Check your tests</h1>
|
||||
{{ tests }}
|
||||
{% for test in tests %}
|
||||
<div class="mainTestContainer">
|
||||
<div class="mainTestName">
|
||||
|
21
trials/migrations/0010_test_created_by.py
Normal file
21
trials/migrations/0010_test_created_by.py
Normal file
@ -0,0 +1,21 @@
|
||||
# Generated by Django 3.2.9 on 2022-01-22 18:57
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
('trials', '0009_auto_20220122_1942'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='test',
|
||||
name='created_by',
|
||||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='tests', to=settings.AUTH_USER_MODEL),
|
||||
),
|
||||
]
|
@ -12,6 +12,12 @@ class Test(models.Model):
|
||||
# related_name="tests"
|
||||
# )
|
||||
category = models.CharField(max_length=100)
|
||||
created_by = models.ForeignKey(
|
||||
"users.User",
|
||||
null=True,
|
||||
related_name="tests",
|
||||
on_delete=models.CASCADE
|
||||
)
|
||||
|
||||
objects = TestManager()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user