mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Fixed regex casting to satisfy pycodestyle
This commit is contained in:
@ -20,9 +20,9 @@ class NaturalOrderByManager(Manager):
|
|||||||
|
|
||||||
# Append the three subfields derived from the designated natural ordering field
|
# Append the three subfields derived from the designated natural ordering field
|
||||||
queryset = queryset.extra(select={
|
queryset = queryset.extra(select={
|
||||||
'_nat1': "CAST(SUBSTRING({}.{} FROM '^(\d{{1,9}})') AS integer)".format(db_table, db_field),
|
'_nat1': r"CAST(SUBSTRING({}.{} FROM '^(\d{{1,9}})') AS integer)".format(db_table, db_field),
|
||||||
'_nat2': "SUBSTRING({}.{} FROM '^\d*(.*?)\d*$')".format(db_table, db_field),
|
'_nat2': r"SUBSTRING({}.{} FROM '^\d*(.*?)\d*$')".format(db_table, db_field),
|
||||||
'_nat3': "CAST(SUBSTRING({}.{} FROM '(\d{{1,9}})$') AS integer)".format(db_table, db_field),
|
'_nat3': r"CAST(SUBSTRING({}.{} FROM '(\d{{1,9}})$') AS integer)".format(db_table, db_field),
|
||||||
})
|
})
|
||||||
|
|
||||||
# Replace any instance of the designated natural ordering field with its three subfields
|
# Replace any instance of the designated natural ordering field with its three subfields
|
||||||
|
Reference in New Issue
Block a user