This commit is contained in:
Dustin J. Mitchell 2021-01-22 16:21:53 +00:00 коммит произвёл Dustin J. Mitchell
Родитель 18b49edc88
Коммит 8269c7d3ec
2 изменённых файлов: 33 добавлений и 1 удалений

Просмотреть файл

@ -0,0 +1,31 @@
# Generated by Django 3.1.2 on 2021-01-22 16:21
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('participants', '0001_initial'),
('pairing', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='pair',
name='learner',
field=models.ForeignKey(limit_choices_to={'role': 'L'}, on_delete=django.db.models.deletion.RESTRICT, related_name='learner_pairing', to='participants.participant'),
),
migrations.AlterField(
model_name='pair',
name='mentor',
field=models.ForeignKey(limit_choices_to={'role': 'M'}, on_delete=django.db.models.deletion.RESTRICT, related_name='mentor_pairing', to='participants.participant'),
),
migrations.AlterField(
model_name='pair',
name='start_date',
field=models.DateTimeField(default=django.utils.timezone.now, help_text='Date this pairing began'),
),
]

Просмотреть файл

@ -5,6 +5,7 @@ from textwrap import dedent
from django.conf import settings
from django.db import models
from django.utils import timezone
from ..participants.models import Participant
@ -32,7 +33,7 @@ class Pair(models.Model):
start_date = models.DateTimeField(
null=False,
default=lambda: datetime.datetime.now(pytz.UTC),
default=timezone.now,
help_text=dedent('''Date this pairing began''')
)