Convert URL patterns to lists.
Review Request #8723 — Created Feb. 7, 2017 and submitted
Django has deprecated the use of the old
patterns()
method, since they now
recommend that all URLs pass in the view directly rather than do string magic
to get the module path. This change moves us over to using plain lists of
url()
entries, rather than a bunch of calls topatterns()
.While I was doing this, I cleaned things up a bit with the regexes (such as
converting[0-9]
to\d
and[a-zA-Z0-9_]
to\w
), and changed it so we
only use raw strings where necessary.
Ran unit tests on Django 1.6 and 1.8.
Description | From | Last Updated |
---|---|---|
Instead of importing each view directly, I'm wondering about just importing views as appname_views (reviews_views, admin_views, etc.). Then we can … |
chipx86 | |
One blank line, for consistency with the above. |
chipx86 | |
I don't love having to mix these throughout the file, but I also never quite loved some of these being … |
chipx86 | |
Mind removing these blank lines before except while here? |
chipx86 | |
I'd prefer to keep the r prefix for all regexes. It makes it a lot easier to copy/paste/modify regexes without … |
chipx86 | |
Swap these. |
chipx86 | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (80 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (80 > 79 characters) |
reviewbot |
-
-
Instead of importing each view directly, I'm wondering about just importing
views
asappname_views
(reviews_views
,admin_views
, etc.). Then we can reference the particular views as attributes instead of managing the import lists. I've seen this pattern with some other Django apps.What are your thoughts?
-
Tool: Pyflakes Processed Files: reviewboard/scmtools/admin.py reviewboard/hostingsvcs/urls.py reviewboard/hostingsvcs/beanstalk.py reviewboard/accounts/urls.py reviewboard/reviews/urls.py reviewboard/hostingsvcs/bitbucket.py reviewboard/admin/urls.py reviewboard/urls.py reviewboard/hostingsvcs/service.py reviewboard/search/urls.py reviewboard/hostingsvcs/github.py reviewboard/hostingsvcs/googlecode.py reviewboard/hostingsvcs/tests/test_registration.py reviewboard/datagrids/urls.py Tool: PEP8 Style Checker Processed Files: reviewboard/scmtools/admin.py reviewboard/hostingsvcs/urls.py reviewboard/hostingsvcs/beanstalk.py reviewboard/accounts/urls.py reviewboard/reviews/urls.py reviewboard/hostingsvcs/bitbucket.py reviewboard/admin/urls.py reviewboard/urls.py reviewboard/hostingsvcs/service.py reviewboard/search/urls.py reviewboard/hostingsvcs/github.py reviewboard/hostingsvcs/googlecode.py reviewboard/hostingsvcs/tests/test_registration.py reviewboard/datagrids/urls.py
-
-
-
I don't love having to mix these throughout the file, but I also never quite loved some of these being top-level to begin with. Can we maybe introduce a
BeanstalkHookViews
class to contain this function and utility functions? Will also help with organization down the road when we add more hooks.Same would apply to the other services.
-
-
I'd prefer to keep the
r
prefix for all regexes. It makes it a lot easier to copy/paste/modify regexes without unintentionally breaking things. -
-
Tool: Pyflakes Processed Files: reviewboard/scmtools/admin.py reviewboard/hostingsvcs/urls.py reviewboard/hostingsvcs/beanstalk.py reviewboard/accounts/urls.py reviewboard/reviews/urls.py reviewboard/hostingsvcs/bitbucket.py reviewboard/admin/urls.py reviewboard/urls.py reviewboard/hostingsvcs/service.py reviewboard/search/urls.py reviewboard/hostingsvcs/github.py reviewboard/hostingsvcs/googlecode.py reviewboard/hostingsvcs/tests/test_registration.py reviewboard/datagrids/urls.py Tool: PEP8 Style Checker Processed Files: reviewboard/scmtools/admin.py reviewboard/hostingsvcs/urls.py reviewboard/hostingsvcs/beanstalk.py reviewboard/accounts/urls.py reviewboard/reviews/urls.py reviewboard/hostingsvcs/bitbucket.py reviewboard/admin/urls.py reviewboard/urls.py reviewboard/hostingsvcs/service.py reviewboard/search/urls.py reviewboard/hostingsvcs/github.py reviewboard/hostingsvcs/googlecode.py reviewboard/hostingsvcs/tests/test_registration.py reviewboard/datagrids/urls.py
-
-
-
-
-
-
-
Tool: Pyflakes Processed Files: reviewboard/scmtools/admin.py reviewboard/hostingsvcs/urls.py reviewboard/hostingsvcs/beanstalk.py reviewboard/accounts/urls.py reviewboard/reviews/urls.py reviewboard/hostingsvcs/bitbucket.py reviewboard/admin/urls.py reviewboard/urls.py reviewboard/hostingsvcs/service.py reviewboard/search/urls.py reviewboard/hostingsvcs/github.py reviewboard/hostingsvcs/googlecode.py reviewboard/hostingsvcs/tests/test_registration.py reviewboard/datagrids/urls.py Tool: PEP8 Style Checker Processed Files: reviewboard/scmtools/admin.py reviewboard/hostingsvcs/urls.py reviewboard/hostingsvcs/beanstalk.py reviewboard/accounts/urls.py reviewboard/reviews/urls.py reviewboard/hostingsvcs/bitbucket.py reviewboard/admin/urls.py reviewboard/urls.py reviewboard/hostingsvcs/service.py reviewboard/search/urls.py reviewboard/hostingsvcs/github.py reviewboard/hostingsvcs/googlecode.py reviewboard/hostingsvcs/tests/test_registration.py reviewboard/datagrids/urls.py