Skip to content

Use Django 2.0 simplified URL routing

Rémi Duraffort requested to merge django-2-simple-urls into master

Simplified routing allows for much better syntax without regexes.

For example,^(?P<job>[0-9]+|[0-9]+.[0-9]+)/(?P<pk>[-_a-zA-Z0-9.]+)/(?P<case_id>[-_a-zA-Z0-9.\(\)+]+)$ turns in to <job_id:job>/<str:testsuite_name>/<str:testcase_id_or_name>.

Conversion process is straight forward except:

  1. A special parser for job id. Since multinode jobs use the {job_id}.{sub_id} syntax a new url type has been defined.
  2. Trailing slashes were preserved as they were. Maybe in the future they can be normalised. The /RPC2/ path is double registered with and without trailing slash to support both cases.
  3. Allows device and worker primary keys to use characters outside of -_a-zA-Z0-9.@.

Each commit is separated between each django app.

Edited by Igor Ponomarev

Merge request reports