Thanks Jim. I'll give this a shot.
On Sep 25, 8:24 pm, Jim McGaw wrote:
> What you might be asking for is the following syntax, that allows you
> to perform queries against the data in more than one table:
>
> CurrentRanking.objects.filter
> (school__schoolseason__league__league_name="League Na
Derek,
I actually had done my model the way you suggested, but changed my
mind. I guess I should listen to my first instinct!
Thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post t
Jim's right, but I'd also suggest redoing your CurrentRanking model so
it has just one foreign key, to SchoolSeason (since that in turn has
fk's to the School model):
class League(models.Model):
league_name = models.CharField(max_length=100)
class School(models.Model):
school_name = mode
What you might be asking for is the following syntax, that allows you
to perform queries against the data in more than one table:
CurrentRanking.objects.filter
(school__schoolseason__league__league_name="League Name").order_by('-
rating')
Those are double underscores between the model names and
Oops. I should have said my current view returns a list of rankings
(school_name, rating) rather than all schools.
On Sep 25, 7:59 pm, jeffself wrote:
> I've got the following models:
>
> class League(models.Model):
> league_name = models.CharField(max_length=100)
>
> class School(models.Mod
I've got the following models:
class League(models.Model):
league_name = models.CharField(max_length=100)
class School(models.Model):
school_name = models.CharField(max_length=100)
class SchoolSeason(models.Model):
season = models.IntegerField()
school = models.ForeignKey(School
6 matches
Mail list logo