From 81fba01d1e047a07c0f466ff66fe217e9f8a6f8f Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Fri, 21 Feb 2025 19:31:24 +0200 Subject: comments --- core/views/editor_helpers.py | 3 ++- urls.py | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/core/views/editor_helpers.py b/core/views/editor_helpers.py index c5390cf..4f6dde8 100644 --- a/core/views/editor_helpers.py +++ b/core/views/editor_helpers.py @@ -213,7 +213,8 @@ def extract_gps(dict): print("failed to find latitude") location = f'{latitude:09.6f} {latref}, {longitude:010.6f} {lonref}' - # 3 digits for longitude, 2 for latitude. + # 3 digits for longitude (0-359) or +/-(0-180), 2 for latitude +/-(0-90) + # we might want to rectify longitude to be always +(0-359)? print(direction) print(altitude) print(timestamp_utc) diff --git a/urls.py b/urls.py index 4803171..38bc944 100644 --- a/urls.py +++ b/urls.py @@ -96,6 +96,14 @@ NOTE - The final _edit and CATCHALL also have to use re_path(). +(?P) +This strange syntax is not a Django funny, it is standard (but obscure) python. +It denotes a "Named Capturing Group" +https://docs.python.org/3/howto/regex.html#non-capturing-and-named-groups +https://dnmtechs.com/understanding-the-django-regular-expression-p-in-python-3/ +https://www.regular-expressions.info/named.html +e.g. the regular expression: +r'^(?P.*)/(?P[^/]+)_cave_edit/$' Many of these patterns do not work because troggle spent many years broken and we have not yet restored all the functions. Some may have never been fully implemented in -- cgit v1.2.3