From 5189569cb37170f2bffa31638fc3c71c685f558c Mon Sep 17 00:00:00 2001 From: Correl Roush Date: Thu, 26 Aug 2010 15:19:32 -0400 Subject: [PATCH] Analyzer app / models --- analyzer/models.py | 19 +++++++++++++++++++ settings.py | 1 + 2 files changed, 20 insertions(+) diff --git a/analyzer/models.py b/analyzer/models.py index 71a8362..8349098 100755 --- a/analyzer/models.py +++ b/analyzer/models.py @@ -1,3 +1,22 @@ from django.db import models # 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) diff --git a/settings.py b/settings.py index 4aa4bde..07b4c1e 100755 --- a/settings.py +++ b/settings.py @@ -92,4 +92,5 @@ INSTALLED_APPS = ( 'django.contrib.messages', # Uncomment the next line to enable the admin: # 'django.contrib.admin', + 'mtgweb.analyzer' )