move checked_in field to baseticket

This commit is contained in:
Stephan Telling 2017-08-18 13:04:13 +02:00
parent ac5fb77c7a
commit 6d5a7522d8
No known key found for this signature in database
GPG key ID: D4892289F36ADA9B
2 changed files with 25 additions and 2 deletions

View file

@ -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),
),
]

View file

@ -30,6 +30,7 @@ class TicketType(CreatedUpdatedModel, UUIDModel):
class BaseTicket(models.Model): class BaseTicket(models.Model):
qrcode_base64 = models.TextField(null=True, blank=True) qrcode_base64 = models.TextField(null=True, blank=True)
ticket_type = models.ForeignKey('TicketType') ticket_type = models.ForeignKey('TicketType')
checked_in = models.BooleanField(default=False)
def save(self, **kwargs): def save(self, **kwargs):
super(BaseTicket, self).save(**kwargs) super(BaseTicket, self).save(**kwargs)
@ -101,8 +102,6 @@ class ShopTicket(BaseTicket, CreatedUpdatedModel, UUIDModel):
blank=True, blank=True,
) )
checked_in = models.BooleanField(default=False)
# overwrite the _get_token method because old tickets use the user_id # overwrite the _get_token method because old tickets use the user_id
def _get_token(self): def _get_token(self):
return hashlib.sha256( return hashlib.sha256(