#8611: Reverse for '<django.contrib.auth.decorators._CheckLogin object at 0x8ee144c>' not found -----------------------------------------+---------------------------------- Reporter: imbac...@gmail.com | Owner: nobody Status: closed | Milestone: Component: Core framework | Version: 1.1 Resolution: invalid | Keywords: Stage: Unreviewed | Has_patch: 0 Needs_docs: 0 | Needs_tests: 0 Needs_better_patch: 0 | -----------------------------------------+---------------------------------- Changes (by kmtracey):
* status: reopened => closed * resolution: => invalid Comment: Replying to [comment:4 ogdoad8]: > In this case, this was probably the most unhelpful error I've ever seen! Am re-opening so that maybe some type-checking can be done in Django to make for a more helpful error message. > This is a bit too vague to be useful as a suggested improvement. Type- checking what, exactly? > You can reproduce this by passing a floating point value (ints don't trigger this) to a template and using that variable as a view argument that's expecting a string. Again, you've left out a lot of details so I have to guess what pattern you might be using, etc. Guessing you have a pattern like: {{{ (r'^thing/(?P<pk>\d+)/$', 'thing_detail'), }}} If you then try in a template: {{{ {% url thing_detail magic_number %} }}} where magic_number is a float variable in the context, the attempt to reverse will fail because the string representation of the float will have a decimal point in it, thus will not patch the `\d+` pattern. Integers work because their string representation matches the pattern. But it would be perfectly legitimate to have a url pattern that did match the string representation of a float, so it isn't like the url tag can arbitrarily reject float arguments. The best it can do is say there is no pattern that matches what you've passed it. If you've got a specific suggestion for improvement feel free to open a new ticket with recreation details including exactly what you are doing, what message you get, what you think would be better, and how you think Django could actually accomplish that. So far as I can tell what you are asking for here is not something that is possible. -- Ticket URL: <http://code.djangoproject.com/ticket/8611#comment:5> Django <http://code.djangoproject.com/> The Web framework for perfectionists with deadlines. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-updates?hl=en -~----------~----~----~----~------~----~------~--~---