Card rarity support

This commit is contained in:
Correl Roush 2010-09-21 15:46:28 -04:00
parent 15bf001831
commit 559958b193
2 changed files with 3 additions and 1 deletions

View file

@ -18,6 +18,7 @@ class Card(models.Model, mtg.Card):
converted_cost = models.IntegerField(default=0) converted_cost = models.IntegerField(default=0)
power = models.CharField(max_length=10) power = models.CharField(max_length=10)
toughness = models.CharField(max_length=10) toughness = models.CharField(max_length=10)
rarity = models.CharField(max_length=1)
text = models.TextField() text = models.TextField()
def __unicode__(self): def __unicode__(self):

View file

@ -20,6 +20,7 @@ def dbimport():
card = Card(name=c.name, type=card_type,cost=c.cost, power=c.power, toughness=c.toughness) card = Card(name=c.name, type=card_type,cost=c.cost, power=c.power, toughness=c.toughness)
card.converted_cost = c.cost.converted() card.converted_cost = c.cost.converted()
card.rarity = c.rarity
card.text = "\n".join(c.text) card.text = "\n".join(c.text)
card.save() card.save()
attributes = [] attributes = []
@ -46,5 +47,5 @@ def deckimport():
c.count += 1 c.count += 1
c.save() c.save()
#dbimport() dbimport()
deckimport() deckimport()