Re: get_object_or_404 and foreignkey

2009-03-08 Thread Jamie Pittock
Thanks again. I'm still new to all this. On Mar 7, 9:37 pm, Daniel Roseman wrote: > On Mar 7, 8:21 pm, Jamie Pittock wrote: > > > Thanks Daniel.  Yeah it's just a way of getting the county so I'll try > > your second option.  Could you possibly point me to the docs that > > explain the double

Re: get_object_or_404 and foreignkey

2009-03-07 Thread Daniel Roseman
On Mar 7, 8:21 pm, Jamie Pittock wrote: > Thanks Daniel.  Yeah it's just a way of getting the county so I'll try > your second option.  Could you possibly point me to the docs that > explain the double underscore? It's the standard syntax for lookups across relationships. See http://docs.djangop

Re: get_object_or_404 and foreignkey

2009-03-07 Thread Jamie Pittock
Thanks Daniel. Yeah it's just a way of getting the county so I'll try your second option. Could you possibly point me to the docs that explain the double underscore? On Mar 7, 7:39 pm, Daniel Roseman wrote: > On Mar 7, 5:42 pm, Jamie Pittock wrote: > > > > > > > Hi, > > > I have an app with c

Re: get_object_or_404 and foreignkey

2009-03-07 Thread Daniel Roseman
On Mar 7, 5:42 pm, Jamie Pittock wrote: > Hi, > > I have an app with countries and counties.  The simplified model is: > > class Country(models.Model): >         name = models.CharField(max_length=50) >         slug = models.SlugField() > >         def __unicode__(self): >                 return

Re: get_object_or_404 and foreignkey

2009-03-07 Thread Jamie Pittock
Sorry, the correct url would be domain.com/country/county/ On Mar 7, 5:42 pm, Jamie Pittock wrote: > Hi, > > I have an app with countries and counties.  The simplified model is: > > class Country(models.Model): >         name = models.CharField(max_length=50) >         slug = models.SlugField()

get_object_or_404 and foreignkey

2009-03-07 Thread Jamie Pittock
Hi, I have an app with countries and counties. The simplified model is: class Country(models.Model): name = models.CharField(max_length=50) slug = models.SlugField() def __unicode__(self): return self.name class County(models.Model): name = mode