On Fri, 2009-02-20 at 22:03 -0800, David MacDougall wrote:
> Hi Malcolm,
> Thanks for your patient guidance. I took your advice on a better name
> for the variable. Now it should return true if the image_is_vertical.
>  I am getting a lot closer, but I think I am losing the photo's ID
> when I get to the templatetag in photos.py. Here's what debug tells
> me:
> 
> ProgrammingError at /homepage/dmtest/
> ERROR: invalid input syntax for integer:
> "homepage.get_piece_dict.lead_story.get_lead_photo" SELECT
> "photos"."id","photos"."creation_date","photos"."photographer_id","photos"."one_off_photographer","photos"."credit","photos"."caption","photos"."photo","photos"."width","photos"."height"
> FROM "photos" WHERE "photos"."id" =
> 'homepage.get_piece_dict.lead_story.get_lead_photo'

The traceback contains a lot more information than that. In particular,
it will tell you which line of code is causing the error.

> 
> 
> here's the new code:
> 
> class WideOrDeepNode(CachedNode):
>     def __init__(self, photoobj, varname):
>         self.photoobj = photoobj
>         self.varname = varname
>         photos.get_object(pk=photoobj)

Is this where the exception is being raised? If so, what does your
get_object() method do? That's something you've written yourself, not
part of Django core.

Also, wherever the cause of the error is, it looks like it comes down to
not passing in an integer where one is expected. So what is the value of
"photoobj" at this point? Is it what you would expect?

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to