add category field, and add unique_together constraint to TokenFind model until I figure out why it is creating duplicates
This commit is contained in:
parent
97ba725ba2
commit
df34d3edf3
19
src/tokens/migrations/0003_token_category.py
Normal file
19
src/tokens/migrations/0003_token_category.py
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
# Generated by Django 2.0.4 on 2018-08-19 15:42
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('tokens', '0002_tokenfind'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='token',
|
||||||
|
name='category',
|
||||||
|
field=models.TextField(default='', help_text='The category/hint for this token (physical, website, whatever)'),
|
||||||
|
preserve_default=False,
|
||||||
|
),
|
||||||
|
]
|
19
src/tokens/migrations/0004_auto_20180819_1743.py
Normal file
19
src/tokens/migrations/0004_auto_20180819_1743.py
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
# Generated by Django 2.0.4 on 2018-08-19 15:43
|
||||||
|
|
||||||
|
from django.conf import settings
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||||
|
('tokens', '0003_token_category'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterUniqueTogether(
|
||||||
|
name='tokenfind',
|
||||||
|
unique_together={('user', 'token')},
|
||||||
|
),
|
||||||
|
]
|
|
@ -13,6 +13,10 @@ class Token(CampRelatedModel):
|
||||||
help_text="The secret token"
|
help_text="The secret token"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
category = models.TextField(
|
||||||
|
help_text="The category/hint for this token (physical, website, whatever)"
|
||||||
|
)
|
||||||
|
|
||||||
description = models.TextField(
|
description = models.TextField(
|
||||||
help_text="The description of the token"
|
help_text="The description of the token"
|
||||||
)
|
)
|
||||||
|
@ -24,6 +28,9 @@ class Token(CampRelatedModel):
|
||||||
|
|
||||||
|
|
||||||
class TokenFind(CampRelatedModel):
|
class TokenFind(CampRelatedModel):
|
||||||
|
class Meta:
|
||||||
|
unique_together = (('user', 'token'))
|
||||||
|
|
||||||
token = models.ForeignKey(
|
token = models.ForeignKey(
|
||||||
'tokens.Token',
|
'tokens.Token',
|
||||||
on_delete=models.PROTECT
|
on_delete=models.PROTECT
|
||||||
|
|
Loading…
Reference in a new issue