Hi Malcolm
 You are right about the essence of the problem.
 The value of photoobj is
"'homepage.get_piece_dict.lead_story.get_lead_photo" and I am trying
to get it to be an integer, the id  of the photo I am trying to
measure.
 I am wondering if I am losing the "homepage" dict by the time I get
to the templatetag,  however I seem to be able to hang on to it when I
wrote a filter that gave me a 0 or 1 depending upon image orientation.
I realized that a 0 or 1 output from a filter was not of much use so I
am trying to get a variable back from a template tag.

 The full output of the trackback is at 
http://webbackup.charleston.net/homepage/dmtest/

 get_object is not defined in this templatetag file, it seems to be in
use throughout the rest of the code in Ellington, but I don't see
get_object in any other templatetag files.



On Feb 22, 6:08 pm, Malcolm Tredinnick <[email protected]>
wrote:
> 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