From 559958b193a6570a6f80e9155986d1f3a5ba3ba5 Mon Sep 17 00:00:00 2001 From: Correl Roush Date: Tue, 21 Sep 2010 15:46:28 -0400 Subject: [PATCH] Card rarity support --- analyzer/models.py | 1 + importutil.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/analyzer/models.py b/analyzer/models.py index 3388fd5..c464b0e 100755 --- a/analyzer/models.py +++ b/analyzer/models.py @@ -18,6 +18,7 @@ class Card(models.Model, mtg.Card): converted_cost = models.IntegerField(default=0) power = models.CharField(max_length=10) toughness = models.CharField(max_length=10) + rarity = models.CharField(max_length=1) text = models.TextField() def __unicode__(self): diff --git a/importutil.py b/importutil.py index 3b3a813..7f48f2d 100644 --- a/importutil.py +++ b/importutil.py @@ -20,6 +20,7 @@ def dbimport(): card = Card(name=c.name, type=card_type,cost=c.cost, power=c.power, toughness=c.toughness) card.converted_cost = c.cost.converted() + card.rarity = c.rarity card.text = "\n".join(c.text) card.save() attributes = [] @@ -46,5 +47,5 @@ def deckimport(): c.count += 1 c.save() -#dbimport() +dbimport() deckimport()