Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix geos polygon for geocontraint #955

Draft
wants to merge 48 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
cbfb345
Update __version__.
May 5, 2023
b61ac04
Merge branch 'dev' into v.3.6.x
May 5, 2023
9b15dc4
Merge branch 'dev' into v.3.6.x
May 10, 2023
a1efc52
Merge branch 'dev' into v.3.6.x
May 15, 2023
af76782
Merge branch 'dev' into v.3.6.x
May 17, 2023
ee8e049
Update g3wadmin.min.css.
May 17, 2023
1aad315
Merge branch 'dev' into v.3.6.x
May 18, 2023
4fd7063
Update package name.
May 23, 2023
c60766a
Update gitignore.
May 23, 2023
79b0135
Merge branch 'dev' into v.3.6.x
May 23, 2023
a23ee4c
Merge branch 'dev' into v.3.6.x
May 25, 2023
19184c7
Merge branch 'dev' into v.3.6.x
May 29, 2023
81acd25
Merge branch 'dev' into v.3.6.x
Jun 5, 2023
8e54b68
Merge branch 'dev' into v.3.6.x
Jun 6, 2023
05f6882
Fix getting git tag on 'stable' version.
Jun 6, 2023
98d3689
Merge branch 'dev' into v.3.6.x
Jun 8, 2023
c00232e
Merge branch 'dev' into v.3.6.x
Jun 20, 2023
3debb2e
Merge branch 'dev' into v.3.6.x
Jun 20, 2023
e1b3ade
Merge branch 'dev' into v.3.6.x
Jul 3, 2023
858190a
Merge branch 'dev' into v.3.6.x
Jul 14, 2023
3651f85
Merge branch 'dev' into v.3.6.x
Aug 7, 2023
788fdce
Fix issue 578 (#586)
wlorenzetti Aug 10, 2023
06327d3
Order list of layouts by layout name property. (#585)
wlorenzetti Aug 10, 2023
8671702
:arrow_up: Client: (#591)
volterra79 Aug 25, 2023
f1338a7
Typo: for users groups. (#589)
wlorenzetti Aug 25, 2023
a9c4385
Fix test.
Sep 20, 2023
9002d8a
:arrow_up: Client: (#602)
volterra79 Sep 21, 2023
df86684
:arrow_up: Client: (#605)
volterra79 Sep 27, 2023
7ec5c8f
:sparkles: Client: (#617)
volterra79 Oct 11, 2023
09121ec
Case layer with more than one geometry field. (#615)
wlorenzetti Oct 11, 2023
37fa64f
Fix anonymous user subset filter. (#625)
wlorenzetti Oct 18, 2023
7f79848
:sparkles: Client: (#630)
volterra79 Oct 23, 2023
5181b2b
:sparkles: Client: (#636)
volterra79 Nov 3, 2023
709580b
:arrow_up: Client: (#644)
volterra79 Nov 8, 2023
9a19af0
⬆️ Bump g3w-client from 3.8.14 to 3.8.15 (#647)
volterra79 Nov 9, 2023
3f1c282
:arrow_up: Client: (#667)
volterra79 Nov 22, 2023
4936c7e
Fix crs property of layer in /api/config API REST. (#658)
wlorenzetti Nov 22, 2023
2dbbf1a
:bug: Fix issue #603 (#690)
wlorenzetti Dec 19, 2023
7853c95
Backport fix issue #701
Jan 3, 2024
432818e
⬆️ Bump g3w-client v3.8.16 and g3w-client-plugin-editing v3.6.8 (#724)
volterra79 Feb 1, 2024
e28c17f
:bug: Fix layer ACL on pws requests. (#725)
wlorenzetti Feb 1, 2024
02cee91
Check for 'field', 'suggest' and 'ordering' API parameters in HTTP PO…
wlorenzetti Feb 12, 2024
705f471
Get REST API parameters from HTTP GET of POST. (#751)
wlorenzetti Feb 12, 2024
a2a2e0e
Fix editing for pk not integer. (#763) (#765)
github-actions[bot] Feb 22, 2024
d71c5d5
Add `macrogroup_id` to group serializer. (#761) (#773)
wlorenzetti Mar 4, 2024
cf197f5
Fix ordering expression declaration. (#937) (#939)
github-actions[bot] Sep 24, 2024
3fa56b9
backporting of fix for #817
Oct 11, 2024
28f742e
Update CI to Ubuntu 22.04 and docker compose
Oct 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 23 additions & 23 deletions .github/workflows/test_runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:

ci_tests:

runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

strategy:
matrix:
Expand All @@ -22,91 +22,91 @@ jobs:
id: extract_branch

- name: Starting Docker compose
run: docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml up -d
run: docker compose -f docker-compose.${{ matrix.qgis_version }}.yml up -d

- name: Copying code into the container
run: |
docker cp ./ "$(docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml ps -q g3w-suite)":/code
docker cp ./ "$(docker compose -f docker-compose.${{ matrix.qgis_version }}.yml ps -q g3w-suite)":/code

- name: Installing Python requirements
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/ && pip3 install -r requirements_docker.txt && pip3 install -r requirements_huey.txt"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/ && pip3 install -r requirements_docker.txt && pip3 install -r requirements_huey.txt"

- name: Installing Caching Python requirements
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/ && pip3 install -r g3w-admin/caching/requirements.txt"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/ && pip3 install -r g3w-admin/caching/requirements.txt"

- name: Installing Filemanager Python requirements
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/ && pip3 install -r g3w-admin/filemanager/requirements.txt"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/ && pip3 install -r g3w-admin/filemanager/requirements.txt"

- name: Installing Qplotly Python requirements
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/ && pip3 install -r g3w-admin/qplotly/requirements.txt"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/ && pip3 install -r g3w-admin/qplotly/requirements.txt"

- name: Installing Openrouteservice Python requirements
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/ && pip3 install -r g3w-admin/openrouteservice/requirements.txt && pip3 install -r g3w-admin/openrouteservice/requirements_testing.txt"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/ && pip3 install -r g3w-admin/openrouteservice/requirements.txt && pip3 install -r g3w-admin/openrouteservice/requirements_testing.txt"

- name: Building g3w-suite
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "/code/ci_scripts/build_suite.sh"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "/code/ci_scripts/build_suite.sh"

- name: Setting up g3w-suite
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "/code/ci_scripts/setup_suite.sh"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "/code/ci_scripts/setup_suite.sh"

- name: Starting Django
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py runserver 0.0.0.0:8000" &
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py runserver 0.0.0.0:8000" &

- name: Waiting for Django
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "wait-for-it -h localhost -p 8000 -t 240"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "wait-for-it -h localhost -p 8000 -t 240"

- name: Running g3w-admin core tests
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test core"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test core"

- name: Running g3w-admin qdjango tests
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test qdjango"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test qdjango"

- name: Running g3w-admin usersmanage tests
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test usersmanage"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test usersmanage"

- name: Running g3w-admin client tests
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test client"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test client"

- name: Running g3w-admin editing tests
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test editing.tests"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test editing.tests"

- name: Running g3w-admin caching tests
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test caching"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test caching"

- name: Running g3w-admin filemanager tests
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test filemanager"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test filemanager"

- name: Running g3w-admin qplotly tests
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test qplotly"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test qplotly"

- name: Running g3w-admin openrouteservice tests
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test openrouteservice"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test openrouteservice"

- name: Running g3w-admin qtimeseries tests
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test qtimeseries"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test qtimeseries"

- name: Running g3w-admin about tests
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test about"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test about"

- name: Setup tmate session
if: ${{ failure() }}
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ Software releases follow theese main branches as described in the compatibility

| Branch | Python | Django | QGIS | [client] | First release | Status |
|------------|----------------|----------------|---------------|----------|---------------|----------------|
| [dev] | 3.10 | 3.2 | 3.28 | dev | Unreleased | ⚠️️ Unstable |
| [v.3.6.x] | 3.10 | 3.2 | 3.28 | 3.8.7 | May 2023 | 🪲️ Bug fixing |
| [v.3.5.x] | 3.10 | 2.2 | 3.22 | 3.7 | Nov 2022 | 🪲️ Bug fixing |
| [dev] | 3.10 | 3.2 | 3.28 | dev | Unreleased | ⚠️️ Unstable |
| [v.3.6.x] | 3.10 | 3.2 | 3.28 | 3.8.16 | January 2024 | 🪲️ Bug fixing |
| [v.3.5.x] | 3.10 | 2.2 | 3.22 | 3.7 | Nov 2022 | 🪲️ Bug fixing |
| [v.3.4.x] | 3.8 | 2.2 | 3.22 | 3.4 | Mar 2022 | 🚨 End of Life |
| [v.3.3.x] | 3.6 | 2.2 | 3.16 | 3.3 | Sep 2021 | 🚨 End of Life |
| [v.3.2.x] | 3.6 | 2.2 | 3.16 | 3.2 | Apr 2021 | 🚨 End of Life |
| [v.3.1.x] | 3.6 | 2.2 | 3.10 | 3.1 | Nov 2020 | 🚨 End of Life |
| [v.3.0.x] | 3.6 | 2.2 | 3.10 | 3.0 | Nov 2020 | 🚨 End of Life |
| [dj22-py3] | 3.6 | 2.2 | [🔗] | | | 🚨 End of Life |
| [py2] | 2.7 | 1.11 | [🔗] | | | 🚨 End of Life |
| [v.3.0.x] | 3.6 | 2.2 | 3.10 | 3.0 | Nov 2020 | 🚨 End of Life |
| [dj22-py3] | 3.6 | 2.2 | [🔗] | | | 🚨 End of Life |
| [py2] | 2.7 | 1.11 | [🔗] | | | 🚨 End of Life |

[dev]: https://github.com/g3w-suite/g3w-admin/tree/dev
[v.3.6.x]: https://github.com/g3w-suite/g3w-admin/tree/v.3.6.x
Expand Down
14 changes: 9 additions & 5 deletions g3w-admin/about/api/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def filter_queryset(self, request, queryset, view):


class UserProjectFilter(BaseFilterBackend):
"""A filter backend for portal module for qdjango project"""
"""A filter backend for about module for qdjango project"""

def filter_queryset(self, request, queryset, view):
"""
Expand All @@ -47,20 +47,24 @@ def filter_queryset(self, request, queryset, view):


class GroupProjectFilter(BaseFilterBackend):
"""A filter backend for portal module for qdjango project , filter by group"""
"""A filter backend for about module for qdjango project , filter by group"""

def filter_queryset(self, request, queryset, view):
"""
Return a filtered queryset by group_id
"""

if 'group_id' in view.kwargs:
queryset = queryset.filter(group_id=view.kwargs['group_id']).order_by('order')

if resolve(request.path_info).url_name == 'about-group-without-macrogroup-api-list':
queryset = queryset.filter(macrogroups__pk=None)

return queryset


class MacroGroupGroupFilter(BaseFilterBackend):
"""A filter backend for portal module for group, filter by macrogroup"""
"""A filter backend for about module for group, filter by macrogroup"""

def filter_queryset(self, request, queryset, view):
"""
Expand All @@ -70,14 +74,14 @@ def filter_queryset(self, request, queryset, view):
queryset = queryset.filter(macrogroups__pk=view.kwargs['macrogroup_id'])

# check for group without macrogroup
if resolve(request.path_info).url_name == 'portal-group-without-macrogroup-api-list':
if resolve(request.path_info).url_name == 'about-group-without-macrogroup-api-list':
queryset = queryset.filter(macrogroups__pk=None)

return queryset


class PanoramicProjectFilter(BaseFilterBackend):
"""A filter backend for portal module for qdjango project , filter by not panoramic"""
"""A filter backend for about module for qdjango project , filter by not panoramic"""

def filter_queryset(self, request, queryset, view):

Expand Down
13 changes: 9 additions & 4 deletions g3w-admin/about/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ def setUpTestData(cls):

cls.project_group2.save()

cls.project_group3 = CoreGroup(name='Group3', title='Group3', header_logo_img='',
srid=G3WSpatialRefSys.objects.get(auth_srid=3857))

cls.project_group3.save()

# create macrogroups
cls.macrogroup = MacroGroup(title='Macrogroup1', logo_img='macrogroup.png')
cls.macrogroup.save()
Expand Down Expand Up @@ -173,7 +178,7 @@ def test_group(self):
response = client.get(url)
self.assertEqual(response.status_code, 200)
jcontent = json.loads(response.content)
self.assertEqual(len(jcontent), 2)
self.assertEqual(len(jcontent), 3)
feature = jcontent[0]
self.assertIn('edit_url', feature)
group = CoreGroup.objects.filter(pk=feature['id'])[0]
Expand Down Expand Up @@ -318,7 +323,7 @@ def test_macrogroup(self):
response = client.get(url)
self.assertEqual(response.status_code, 200)
jcontent = json.loads(response.content)
self.assertEqual(len(jcontent), 2)
self.assertEqual(len(jcontent), 1)

# ad new group without macrogroup
new_group = CoreGroup(name='Group33', title='Group33', header_logo_img='',
Expand All @@ -328,8 +333,8 @@ def test_macrogroup(self):
response = client.get(url)
self.assertEqual(response.status_code, 200)
jcontent = json.loads(response.content)
self.assertEqual(len(jcontent), 3)
self.assertEqual(jcontent[2]['name'], 'Group33')
self.assertEqual(len(jcontent), 2)
self.assertEqual(jcontent[1]['name'], 'Group33')

client.logout()

Expand Down
2 changes: 1 addition & 1 deletion g3w-admin/base/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
logger.warning('Celery could not be imported, this might be ok if there are no custom suite modules that require Celery')


__version__ = (3, 6, 0, 'unstable', 0)
__version__ = (3, 6, 0, 'stable', 0)
2 changes: 2 additions & 0 deletions g3w-admin/caching/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ def test_tilestache_api(self):
client = Client()
layer = Layer.objects.get(project=self.project.instance, qgs_layer_id='spatialite_points20190604101052075')
assign_perm('view_project', self.anonymoususer, self.project.instance)
for l in self.project.instance.layer_set.all():
assign_perm("view_layer", self.anonymoususer, l)

# active caching for layer
cachinglayer = G3WCachingLayer.objects.create(app_name='qdjango', layer_id=layer.pk)
Expand Down
41 changes: 1 addition & 40 deletions g3w-admin/client/static/client/js/app.min.js

Large diffs are not rendered by default.

9 changes: 1 addition & 8 deletions g3w-admin/client/static/client/js/vendor.min.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions g3w-admin/core/api/base/vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import deprecation

from qgis.core import QgsWkbTypes
from core.utils.qgisapi import get_layer_fids_from_server_fids

class MetadataVectorLayer(object):
"""
Expand Down Expand Up @@ -33,5 +34,5 @@ def get_feature(self, pk):
"""
Returns a (possibly invalid) single feature from QGIS layer
"""

return self.qgis_layer.getFeature(int(pk))
pk = get_layer_fids_from_server_fids([str(pk)], self.qgis_layer)[0]
return self.qgis_layer.getFeature(pk)
8 changes: 6 additions & 2 deletions g3w-admin/core/api/base/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,8 @@ def response_data_mode(self, request, export_features=False):
# --------------------------------------
# IDEA: for big data it'll be iterate over features to get unique
# c++ iteration is fast. Instead memory layer with too many features can be a problem.
if 'unique' in request.query_params:
if 'unique' in self.request_data:


vl = QgsVectorLayer(QgsWkbTypes.displayString(self.metadata_layer.qgis_layer.wkbType()),
"temporary_vector", "memory")
Expand All @@ -498,7 +499,7 @@ def response_data_mode(self, request, export_features=False):

uniques = vl.uniqueValues(
self.metadata_layer.qgis_layer.fields().indexOf(
request.query_params.get('unique'))
self.request_data.get('unique'))
)

values = []
Expand Down Expand Up @@ -642,6 +643,9 @@ def get_response(self, request, mode_call=None, project_type=None, layer_id=None
# set reprojecting status
self.set_reprojecting_status()

# Get request data by GET or POST method
self.request_data = request.query_params if request.method == 'GET' else request.data

# get results
response = self.get_response_data(request)

Expand Down
31 changes: 26 additions & 5 deletions g3w-admin/core/api/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,18 @@ def apply_filter(self, request, metadata_layer, qgis_feature_request, view):

qgis_layer = metadata_layer.qgis_layer

if request.query_params.get('search'):
# Try to get param from GET
search_value = request.query_params.get('search')

if not search_value:
# Try to get from POST
search_value = request.data.get('search')

if search_value:

search_parts = []

for search_term in request.query_params.get('search').split(','):
for search_term in search_value.split(','):

search_term = self._quote_value('%' + search_term + '%')
exp_template = '{field_name} ILIKE ' + search_term
Expand Down Expand Up @@ -114,11 +121,18 @@ def apply_filter(self, request, metadata_layer, qgis_feature_request, view):

qgis_layer = metadata_layer.qgis_layer

if request.query_params.get('ordering') is not None:
# Try to get param from GET
ordering_value = request.query_params.get('ordering')

if not ordering_value:
# Try to get from POST
ordering_value = request.data.get('ordering')

if ordering_value is not None:

ordering_rules = []

for ordering in request.query_params.get('ordering').split(','):
for ordering in ordering_value.split(','):
ascending = True
if ordering.startswith('-'):
ordering = ordering[1:]
Expand All @@ -127,8 +141,10 @@ def apply_filter(self, request, metadata_layer, qgis_feature_request, view):
if not self._is_valid_field(qgis_layer, ordering, view):
continue

# Because the fields inside a QGIS expression must be declared inside
# the expression string with the double brackets ("field_name")
ordering_rules.append(QgsFeatureRequest.OrderByClause(
ordering, ascending))
f'"{ordering}"', ascending))

if ordering_rules:
order_by = QgsFeatureRequest.OrderBy(ordering_rules)
Expand Down Expand Up @@ -215,8 +231,13 @@ def apply_filter(self, request, metadata_layer, qgis_feature_request, view):

qgis_layer = metadata_layer.qgis_layer

# Try to get param from GET
suggest_value = request.query_params.get('suggest')

if not suggest_value:
# Try to get from POST
suggest_value = request.data.get('suggest')

if suggest_value:

# get field and value
Expand Down
3 changes: 3 additions & 0 deletions g3w-admin/core/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,9 @@ def to_representation(self, instance):
if layout_right_panel:
ret['layout']['rightpanel'] = layout_right_panel

# Macrogroups
ret['macrogroup_id'] = [macrogroup.id for macrogroup in instance.macrogroups.all()]

return ret

class Meta:
Expand Down
Loading
Loading