Update URL patterns to use new path() and re_path().

Review Request #11956 — Created Jan. 21, 2022 and submitted

Information

Djblets
release-3.x

Reviewers

Django 2+ provides a new method for definings URLs, path(). This is
much simpler for basic cases, and makes URL patterns more readable. In
addition, the old url() method has been renamed to re_path(), and a
warning is raised when using the old name, so switch to that too.

Ran unit tests.

Summary ID
Update URL patterns to use new path() and re_path().
Django 2+ provides a new method for definings URLs, `path()`. This is much simpler for basic cases, and makes URL patterns more readable. In addition, the old `url()` method has been renamed to `re_path()`, and a warning is raised when using the old name, so switch to that too. Testing Done: Ran unit tests.
0bffd78fa1db5fba618a57556aa84c6751228e59
Description From Last Updated

Mind tweaking the summary to be a little more clear on what this does? I went into this thinking the …

chipx86chipx86

W605 invalid escape sequence '\.'

reviewbotreviewbot

E501 line too long (84 > 79 characters)

reviewbotreviewbot

E501 line too long (80 > 79 characters)

reviewbotreviewbot

Alignment is off.

chipx86chipx86

Alignment is off.

chipx86chipx86

Alignment is off.

chipx86chipx86

Alignment is off. Can we just put the { on the path( line so that we can keep the contents …

chipx86chipx86

This was already here, but the }) alignment is off.

chipx86chipx86

Alignment is off.

chipx86chipx86

Indentation of the subsequent lines are all too far.

chipx86chipx86

django.urls should be last.

chipx86chipx86
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

david
chipx86
  1. 
      
  2. Show all issues

    Mind tweaking the summary to be a little more clear on what this does? I went into this thinking the change was going to be something entirely different.

  3. djblets/extensions/manager.py (Diff revision 2)
     
     
     
    Show all issues

    Alignment is off.

  4. djblets/extensions/manager.py (Diff revision 2)
     
     
     
    Show all issues

    Alignment is off.

  5. djblets/extensions/tests/test_url_hook.py (Diff revision 2)
     
     
     
    Show all issues

    Alignment is off.

  6. djblets/extensions/tests/test_views.py (Diff revision 2)
     
     
     
     
     
     
     
    Show all issues

    Alignment is off.

    Can we just put the { on the path( line so that we can keep the contents nicely indented 4 spaces relative to path(? I think we may also want to make this a kwargs={?

  7. djblets/feedview/test_urls.py (Diff revision 2)
     
     
     
    Show all issues

    This was already here, but the }) alignment is off.

  8. djblets/urls/root.py (Diff revision 2)
     
     
     
    Show all issues

    Alignment is off.

  9. 
      
david
david
chipx86
  1. 
      
  2. djblets/extensions/tests/test_views.py (Diff revision 3)
     
     
     
     
     
     
     
    Show all issues

    Indentation of the subsequent lines are all too far.

  3. djblets/urls/root.py (Diff revision 3)
     
     
     
     
     
    Show all issues

    django.urls should be last.

  4. 
      
david
chipx86
  1. Ship It!
  2. 
      
david
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-3.x (870a9095).

Loading...