Opened 6 years ago

Closed 6 years ago

#9901 closed (duplicate)

Problem with url tag

Reported by: patrick91 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: UI/UX:

Description (last modified by gwilson)

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 Changed 6 years ago by gwilson

  • Description modified (diff)
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

fixed description formatting.

comment:2 Changed 6 years ago by gwilson

  • Resolution set to duplicate
  • Status changed from new to closed

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 Changed 6 years ago by patrick91

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 Changed 6 years ago by patrick91

  • Resolution duplicate deleted
  • Status changed from closed to reopened

nothing, I couldn't find any error :(

could you help me how to apply the patch?

thanks

comment:5 Changed 6 years ago by ubernostrum

  • Resolution set to duplicate
  • Status changed from reopened to closed

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