Analyzer app / models
This commit is contained in:
parent
4994f82b47
commit
5189569cb3
2 changed files with 20 additions and 0 deletions
|
@ -1,3 +1,22 @@
|
||||||
from django.db import models
|
from django.db import models
|
||||||
|
|
||||||
# Create your models here.
|
# Create your models here.
|
||||||
|
class Attribute(models.Model):
|
||||||
|
name = models.CharField(max_length=200, unique=True, db_index=True)
|
||||||
|
def __unicode__(self):
|
||||||
|
return self.name
|
||||||
|
class Card(models.Model):
|
||||||
|
name = models.CharField(max_length=200, unique=True)
|
||||||
|
type = models.CharField(max_length=200)
|
||||||
|
attributes = models.ManyToManyField(Attribute)
|
||||||
|
cost = models.CharField(max_length=80)
|
||||||
|
converted_cost = models.IntegerField(default=0)
|
||||||
|
power = models.CharField(max_length=10)
|
||||||
|
toughness = models.CharField(max_length=10)
|
||||||
|
text = models.TextField()
|
||||||
|
|
||||||
|
def __unicode__(self):
|
||||||
|
return self.name
|
||||||
|
class Deck(models.Model):
|
||||||
|
name = models.CharField(max_length=80)
|
||||||
|
cards = models.ManyToManyField(Card)
|
||||||
|
|
|
@ -92,4 +92,5 @@ INSTALLED_APPS = (
|
||||||
'django.contrib.messages',
|
'django.contrib.messages',
|
||||||
# Uncomment the next line to enable the admin:
|
# Uncomment the next line to enable the admin:
|
||||||
# 'django.contrib.admin',
|
# 'django.contrib.admin',
|
||||||
|
'mtgweb.analyzer'
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue