Re: get_absolute_url() using related models slugs

2008-04-25 Thread Merrick
Thank you Malcolm and Karen, I had to step for the day but when I got home I read your comments and fixed the issue which was exactly as you both pointed out. this helped make my photo model much more search friendly. @permalink def get_absolute_url(self): return

Re: get_absolute_url() using related models slugs

2008-04-24 Thread Karen Tracey
On Thu, Apr 24, 2008 at 12:21 PM, Merrick <[EMAIL PROTECTED]> wrote: > > Thank you, I updated get_absolute_url to take into consideration the > fact that I was erroneously using state_slug instead of state.slug and > the same with photo.slug and place.slug > >def get_absolute_url(self): >

Re: get_absolute_url() using related models slugs

2008-04-24 Thread Merrick
Thank you, I updated get_absolute_url to take into consideration the fact that I was erroneously using state_slug instead of state.slug and the same with photo.slug and place.slug def get_absolute_url(self): return ('photo-detail', None, { 'state' : self.photo.place.city.state.slug

Re: get_absolute_url() using related models slugs

2008-04-24 Thread Malcolm Tredinnick
On Thu, 2008-04-24 at 09:08 -0700, Merrick wrote: > Sorry to confuse things, I actually thought putting the shell output > would give a bigger picture. > > The problem I am trying to solve is getting related to > get_absolute_url() > > >>> photo.get_absolute_url() > Traceback (most recent call

Re: get_absolute_url() using related models slugs

2008-04-24 Thread Merrick
Sorry to confuse things, I actually thought putting the shell output would give a bigger picture. The problem I am trying to solve is getting related to get_absolute_url() >>> photo.get_absolute_url() Traceback (most recent call last): File "", line 1, in ? File

Re: get_absolute_url() using related models slugs

2008-04-24 Thread Malcolm Tredinnick
On Thu, 2008-04-24 at 08:55 -0700, Merrick wrote: [...] > ***Shell output > > >>> from photologue.models import * > >>> photo = Photo.objects.get(slug='golf-course-3') > >>> photo.place.city.state_slug > Traceback (most recent call last): > File "", line 1, in ? > AttributeError: 'City'

get_absolute_url() using related models slugs

2008-04-24 Thread Merrick
I am still learning Django, and appreciate all of the help I have received. I spent a few hours on this and just cannot figure out how to pull off the get_absolute_url() function the way I describe it below for the Photo class. I want to use the slugs for related models and step through multiple