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 das
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
Russ-
Okay, one more question I changed the view around to make the code a
bit cleaner and use your suggestion as well as the render_to_response
shortcut I read about in the docs..
def view_items_tagged(request, tag):
essay_list = Essay.objects.filter(tags=tag)
return render_to_response
On 10/24/06, luxagraf <[EMAIL PROTECTED]> wrote:
>
> Russ-
>
> ah. okay that makes sense. I was assuming that entry_set was a
> contruct itself, but it's actually modelname_set...
Yup.
> So to make it purely abstract, things are working like this:
>
> response_obj = get_object_or_404(Model, para
Russ-
ah. okay that makes sense. I was assuming that entry_set was a
contruct itself, but it's actually modelname_set...
So to make it purely abstract, things are working like this:
response_obj = get_object_or_404(Model, param=value)
response_obj.modelname_set.all().select_related()
and I can
On 10/24/06, luxagraf <[EMAIL PROTECTED]> wrote:
>
> "'Tag' object has no attribute 'entry_set'"
>
> Which I believe means that get_object_or_404 is not finding anything
> to return... and yet the correct tag is being passed in and the error
> reporting shows the value of tag being what it should.
Hello all,
I'm new to django but I'm figuring things out for the most part. I've
built a simple blog app with entries and tags as a kind of starter
app...
Anyway I'm having a problem with my first attempt at a custom view.
What i want to do is show a list of entries that have a given tag so
I've
7 matches
Mail list logo