django noob question

2012-01-27 Thread yousuf
this is my models.py from django.db import models # Create your models here. class Leagues(models.Model): LeagueName = models.CharField(max_length=200) class Team(models.Model): TeamName = models.CharField(max_length=200) class LeagueTable(models.Model): league = models.ForeignKey(

Re: django noob question

2012-01-27 Thread adj7388
Without knowing your problem domain, you might want to start off with: class League(models.Model): name = models.CharField(max_length=200) class Team(models.Model): name = models.CharField(max_length=200) league = models.ForeignKey(League) Generally you don't want a model with a plur

Re: django noob question

2012-01-27 Thread adj7388
I forgot to address the issue of your LeagueTable, which appears to be a way to keep track of standings. It looks like what you're really doing is trying to keep track of matches won and lost, points earned, etc i.e., the standings of a league. One way to do this is with a Match model: class Matc