Still must be doing something wrong.
My urls.py has:
(r'^foodlog/$', 'foodlog.views.index'),
(r'^foodlog/(\d+)/$', 'foodlog.views.details'),
My views.py has:
----- snip
def index(request):
latest_log_entries = foods.get_list()
return render_to_response('foodlog/index',
{'latest_log_entries': latest_log_entries
})
def details(request, entryid):
try:
fentry = foods.get_object(pk=entryid)
except:
raise Http404
t = template_loader.get_template('foodlog/detail')
c = Context(request, {
'fentry': fentry
})
return HttpResponse(t.render(c))
----- end snip
I have 2 entries added through the admin interface and they show up in
my index template. When I click on one and it passes the id to my
details template I believe I should have a dictionary with all of that
items entries. But all I seem to get is the id itself and nothing
else.
My index.html has:
--- snip
{% if latest_log_entries %}
<ul>
{% for entry in latest_log_entries %}
<li><a href="/foodlog/{{ entry.id }}">{{ entry.eat_date|date:"F
j, Y
@ h:m A" }}</a> - {{ entry.description }} </li>
{% endfor %}
</ul>
{% else %}
<p>No foodlog entries.</p>
{% endif %}
--- end snip
My details.html has (just to see what was passed):
--- snip
{{ fentry }}
--- end snip
Any words of wisdom are appreciated!
Thanks,
Brian
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---