News for hackers. Stuff that matters.
Re:Django 2.0 alpha by Ralfp on Saturday September 23, 2017 @01:01PM (#15320606)
There's new `path()` as alternative to `url()` that allows one to use easier to remember syntax for url params like `<int:id>` instead of past `(?P<year>[0-9]{4})`. But if you need it, there's still `url()` for you to use power of regex in your urls.

And your shop still runs on Py2k, you'll need to move to Py3k to use Django 2.0. This also means that websockets support will not land on Django version that works for Py2k.

Re:Django 2.0 alpha by switch007 on Saturday September 23, 2017 @01:42PM (#15320793)
How is <int:id> identical to (?P<year>[0-9]{4})? I'm talking about the {4}. Just an error in their blog post?
Re:Django 2.0 alpha by westurner on Saturday September 23, 2017 @02:50PM (#15321075)
Does it support negative long integers?

EDIT: I am without actual internet or mobile tethering and an unable to `git clone https://github.com/django/django -b stable/2.0.x` and check out this convenient new feature.

Re:Django 2.0 alpha by ubernostrum on Saturday September 23, 2017 @04:12PM (#15321477)
It's still regex under the hood, the 'int' is just syntactic sugar for "[0-9]+":

https://github.com/django/django/blob/dda37675db0295baefef37...

Re:Django 2.0 alpha by westurner on Sunday September 24, 2017 @10:29PM (#15327690)
Thanks!
Re:Django 2.0 alpha by whalesalad on Saturday September 23, 2017 @04:09PM (#15321454)
Seriously? I mean you can achieve that with your own regex the old way. Surprised you’re asking the commenters here to investigate such a specific and odd use case of a convenience method.
Re:Django 2.0 alpha by lozenge on Sunday September 24, 2017 @05:19AM (#15324023)
You normally would want a three digit year to 404, and the same is true for a silly year like `3456` - you would 404 in the view. So, it isn't identical, but close enough for most purposes, as your view probably already has code to return 404.