Opened 16 years ago

Last modified 16 years ago

#9901 closed

Problem with url tag — at Initial Version

Reported by: patrick Owned by: nobody
Component: HTTP handling Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Hi, I've a problem with the url tag, when I call this template from a view:
<a href="{% url show_worksheet worksheet.number %}">Visualizza</a>
I get this error:
{{{Caught an exception while rendering: Reverse for
'catsnc.show_worksheet' with arguments '(5537,)' and keyword arguments
'{}' not found.
}}}
But when I call this code from the shell:
{{{>>> from django.core.urlresolvers import reverse

reverse('show_worksheet', args=(5537,))

}}}
I get the url:
'/riparazioni/foglio/5537/'

or:

>>> from django.template import Template, Context
>>> from reparations.models import WorkSheet
>>> w = WorkSheet.objects.get(pk=1)
>>> c = Context({ 'w': w })
>>> t = Template("{% url show_worksheet w.number  %}")
>>> t.render(c) }}}
I get:
u'/riparazioni/foglio/5537/'


could you help me to resolve this problem?

Thanks :) 

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top