Opened 15 years ago

Closed 15 years ago

#9901 closed (duplicate)

Problem with url tag

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 (last modified by Gary Wilson)

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 (5)

comment:1 by Gary Wilson, 15 years ago

Description: modified (diff)

fixed description formatting.

comment:2 by Gary Wilson, 15 years ago

Resolution: duplicate
Status: newclosed

I believe this is a duplicate of #6379. Please check your code for import errors, and re-open this ticket if you don't find anything. You could try applying the patch attached to #6379 to see if it helps you find the cause of the error.

comment:3 by patrick, 15 years ago

thanks for the reply, but I couldn't find any error :( and I don't know how to apply the patch (I think the patch is out-to-date, I use django 1.0.2)

comment:4 by patrick, 15 years ago

Resolution: duplicate
Status: closedreopened

nothing, I couldn't find any error :(

could you help me how to apply the patch?

thanks

comment:5 by James Bennett, 15 years ago

Resolution: duplicate
Status: reopenedclosed

Closing as a duplicate per Gary's comment above. If you have usage questions, please take them to the django-users mailing list.

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