Russ-

print_r does roughly what {% debug %} does, thanks for that tip.

I realized that I can't use the method you mentioned because my Tag
model has a slug field but the Essay model only stores the Tag.name
value, which is fine until I have multiword tags. So i'd either need
to strip out the dashes fromt the GET var or use two queries. Both of
which feel clumsy to me, but for now it'll have to do.

That doesn't explain why I'm getting an empty list object (because the
page I was testing was a single word tag), but I guess for now I'll
just use the double query method until I can come up with a cleaner
way of doing it.

Thanks again for taking the time to help.

cheers
sng
<http://luxagraf.net>


On 10/24/06, Russell Keith-Magee <[EMAIL PROTECTED]> wrote:
>
> On 10/24/06, luxagraf <[EMAIL PROTECTED]> wrote:
> >
> > Which works and the template loads, but there doesn't seem to be
> > anything in the object essay_list...
>
> Your view and template appear to be ok, as long as the 'tag' argument
> is of a type compatible with the query.
>
> > is there a
> > python way to have essay_list get spit out something like
> > print_r(essay_list) would do in php...?
>
> I have never used PHP, so I have no idea what print_r does; however,
> here are a few useful debugging techinques:
>
> 1) Does it work in a shell? ./manage.py shell provides a shell
> environment that lets you try out queries before you use them in your
> view. This can be used to check that your query works, and that there
> are data to return.
>
> 2) Put some print statements in your view. The output of these
> statements will appear in the development server log. Use these
> printouts to validate that a) 'tag' is value of a type that can be
> used in a query, and b) essay_list has entries that match the tag.
>
> 3) Put the {% debug %} template tag in your template. This will output
> a whole lot of data about your template, context, etc.
>
> Hope this helps.
>
> Yours,
> Russ Magee %-)
>
> >
>

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

Reply via email to