Re: URL dispatcher API

2015-07-10 Thread Marc Tamlyn
+100 for django.urls. resolving and reversing functions should be located in the same namespace. M On 10 Jul 2015 15:55, "Marten Kenbeek" wrote: > Hi James, > > Thanks for taking a look at this, I really appreciate it. > > *Major bug:* the `request` object needs to be passed into `resolve()` >>

Re: URL dispatcher API

2015-07-10 Thread Marten Kenbeek
Hi James, Thanks for taking a look at this, I really appreciate it. *Major bug:* the `request` object needs to be passed into `resolve()` here: > https://github.com/knbk/django/blob/4a9d2a05bb76c9ad996921b9efadd8dad877540e/django/core/handlers/base.py#L134 > > - otherwise host and scheme cons

Re: URL dispatcher API

2015-07-10 Thread Tim Graham
Marten, did you consider putting the new API in `django.urls` instead of `django.core.urls`? I don't need there's a need to namespace it under "core", but others might be able to confirm the philosophy behind this. On Thursday, July 9, 2015 at 7:19:11 AM UTC-4, James Addison wrote: > > Marten, >

Re: [ANNOUNCE] Django security releases issued (1.4.21, 1.7.9, and 1.8.3)

2015-07-10 Thread Łukasz Rekucki
Tom's question got me thinking. Should non-ASCII numerals be allowed ? import re for x in ("10", "६"): print("INT", int(x)) print("RE", re.match("^-?\d+\Z", x) is not None) On Python 3 this returns True and True unless you add re.ASCII flag. On 10 July 2015 at 12:32, Florian Apolloner

Re: [ANNOUNCE] Django security releases issued (1.4.21, 1.7.9, and 1.8.3)

2015-07-10 Thread Florian Apolloner
In [1]: int(' 5 ') Out[1]: 5 Cheers, Florian On Friday, July 10, 2015 at 12:00:20 PM UTC+2, tomv wrote: > > Out of interest what's wrong with casting to int and checking for > exceptions? > > This is the removed code: > > try: > int(value) > except (ValueError, T

Re: [ANNOUNCE] Django security releases issued (1.4.21, 1.7.9, and 1.8.3)

2015-07-10 Thread tomv
Out of interest what's wrong with casting to int and checking for exceptions? This is the removed code: try: int(value) except (ValueError, TypeError): raise ValidationError(_('Enter a valid integer.'), code='invalid') Does this match different strings than the new regex