From 6d5a7522d8c3e8e446b0d2896157dfb3df4579f3 Mon Sep 17 00:00:00 2001 From: Stephan Telling Date: Fri, 18 Aug 2017 13:04:13 +0200 Subject: [PATCH] move checked_in field to baseticket --- .../migrations/0004_auto_20170818_1303.py | 24 +++++++++++++++++++ src/tickets/models.py | 3 +-- 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 src/tickets/migrations/0004_auto_20170818_1303.py diff --git a/src/tickets/migrations/0004_auto_20170818_1303.py b/src/tickets/migrations/0004_auto_20170818_1303.py new file mode 100644 index 00000000..cd3ff42a --- /dev/null +++ b/src/tickets/migrations/0004_auto_20170818_1303.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.5 on 2017-08-18 11:03 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('tickets', '0003_auto_20170817_1938'), + ] + + operations = [ + migrations.RemoveField( + model_name='shopticket', + name='checked_in', + ), + migrations.AddField( + model_name='baseticket', + name='checked_in', + field=models.BooleanField(default=False), + ), + ] diff --git a/src/tickets/models.py b/src/tickets/models.py index 63206888..f535e426 100644 --- a/src/tickets/models.py +++ b/src/tickets/models.py @@ -30,6 +30,7 @@ class TicketType(CreatedUpdatedModel, UUIDModel): class BaseTicket(models.Model): qrcode_base64 = models.TextField(null=True, blank=True) ticket_type = models.ForeignKey('TicketType') + checked_in = models.BooleanField(default=False) def save(self, **kwargs): super(BaseTicket, self).save(**kwargs) @@ -101,8 +102,6 @@ class ShopTicket(BaseTicket, CreatedUpdatedModel, UUIDModel): blank=True, ) - checked_in = models.BooleanField(default=False) - # overwrite the _get_token method because old tickets use the user_id def _get_token(self): return hashlib.sha256(