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
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):
>
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
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
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
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'
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
7 matches
Mail list logo