Add submitted field
This commit is contained in:
1 parent
082661055e
commit
d553d6c2ef
4 files changed
+55
No files matched your search
@@ -0,0 +1,33 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
from django.conf import settings
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Answer',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('question', models.CharField(max_length=128)),
|
||||
('string', models.TextField()),
|
||||
('points', models.IntegerField(null=True)),
|
||||
('comment', models.TextField(null=True)),
|
||||
('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
options={
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.AlterUniqueTogether(
|
||||
name='answer',
|
||||
unique_together=set([('user', 'question')]),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,20 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('quiz', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='answer',
|
||||
name='submitted',
|
||||
field=models.DateField(auto_now_add=True, null=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
]
|
||||
Whitespace-only changes.
@@ -11,6 +11,8 @@ class Answer(models.Model):
|
||||
points = models.IntegerField(null=True)
|
||||
comment = models.TextField(null=True)
|
||||
|
||||
submitted = models.DateField(auto_now_add=True, null=True)
|
||||
|
||||
class Meta:
|
||||
unique_together = ('user', 'question')
|
||||
|
||||
|
||||
Reference in new issue
Block a user