Added field type to amiiboshop

This commit is contained in:
Felipe Martín 2015-08-27 23:06:41 +02:00
parent 5fa4c50e52
commit f6d0adedfb
2 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('amiibo', '0019_auto_20150827_1825'),
]
operations = [
migrations.AddField(
model_name='amiiboshop',
name='type',
field=models.CharField(default=1, max_length=1, choices=[(1, b'Figure'), (2, b'Pack')]),
),
]

View File

@ -150,8 +150,17 @@ class AmiiboCard(models.Model):
class AmiiboShop(models.Model):
FIGURE = 1
PACK = 2
ITEM_TYPES = (
(FIGURE, 'Figure'),
(PACK, 'Pack'),
)
amiibo = models.ForeignKey(Amiibo, related_name='shops_set')
shop = models.ForeignKey('shop.Shop', related_name='amiibos_set')
type = models.CharField(choices=ITEM_TYPES, default=FIGURE, max_length=1)
url = models.TextField()
item_id = models.CharField(max_length=64)
check_price = models.BooleanField(default=True)