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

[Fixes #6966] Thesauri intial data #6967

Merged
merged 29 commits into from
Feb 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
f654111
Merge pull request #626 from geosolutions-it/merge_from_upsteram
giohappy Jan 20, 2021
0df9357
Merge branch 'master' of https://github.com/GeoNode/geonode
allyoucanmap Feb 1, 2021
2a11ead
Bump urllib3 from 1.26.2 to 1.26.3 (#6908)
dependabot[bot] Feb 2, 2021
040772e
[Fixes #6880] Circle CI upload tests fail irregulary (#6881)
t-book Feb 2, 2021
65c6267
[Fixes #6914] Remove "add to basket" tool for documents and maps (#6915)
Feb 2, 2021
158511a
Added malnajdi as contributor
t-book Feb 2, 2021
e9efc3d
[Fixes #6910] meaningful filename for document download (#6911)
gannebamm Feb 2, 2021
91f1a4e
- CircleCI Upload Tests: trying to reduce more the risk of infinite …
afabiani Feb 2, 2021
5e77b39
[Fixes #6916] gsimporter.api.NotFound caused by missing trailing slas…
malnajdi Feb 3, 2021
ec6d728
Bump django-cors-headers from 3.6.0 to 3.7.0 (#6901)
dependabot[bot] Feb 3, 2021
c5432b5
Bump amqp from 5.0.3 to 5.0.5 (#6905)
dependabot[bot] Feb 3, 2021
28424ca
Bump pip from 21.0 to 21.0.1 (#6900)
dependabot[bot] Feb 3, 2021
be313d5
Bump coverage from 5.3.1 to 5.4 (#6903)
dependabot[bot] Feb 3, 2021
f073274
Bump pytest from 6.2.1 to 6.2.2 (#6907)
dependabot[bot] Feb 3, 2021
9a3913e
Bump djangorestframework-gis from 0.16 to 0.17 (#6902)
dependabot[bot] Feb 3, 2021
ae6f6c1
- Algin setup.cfg to requirements.txt
afabiani Feb 3, 2021
0dad216
[Fixes #6922][REST API v2] Expose the curated thumbnail URL if it has…
Feb 3, 2021
30910b2
[Fixes #6918] Removal of QGIS support (#6919)
Feb 3, 2021
dbb4ac0
Merge branch 'master' of https://github.com/GeoNode/geonode
Feb 4, 2021
0bcf2fb
allow Basic authenticated requests in LOCKDOWN mode
bieganowski Feb 5, 2021
af22a3c
fix to avoid circular import
bieganowski Feb 5, 2021
c7ede4f
flake8 check fix
bieganowski Feb 5, 2021
b557f6d
added tests
bieganowski Feb 5, 2021
0a82a14
Merge pull request #652 from geosolutions-it/feature#650_basic_auth_m…
Feb 5, 2021
164eb88
Merge remote-tracking branch 'upstream/master'
mattiagiupponi Feb 17, 2021
dc51323
Merge remote-tracking branch 'upstream/master' into ISSUE_6966
mattiagiupponi Feb 19, 2021
0a150f2
Fixes #6966: fix initial data for thesaurus, add custom data for test…
mattiagiupponi Feb 19, 2021
c767c9f
Fixes #6966: fix flake8 syntax
mattiagiupponi Feb 19, 2021
97e8f82
Fixes #6966: thesaurus removed from initial_data.json
mattiagiupponi Feb 19, 2021
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
5 changes: 4 additions & 1 deletion geonode/base/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@

from django import forms

from django.conf import settings


class MultiThesauriField(forms.ModelMultipleChoiceField):

def label_from_instance(self, obj):
# Note: Not using .get() because filter()[0] is used in original
# code. The hard-coded language is currently used throughout
# geonode.
return obj.keyword.filter(lang='en').first().label
lang = settings.THESAURUS_DEFAULT_LANG if hasattr(settings, "THESAURUS_DEFAULT_LANG") else "en"
return obj.keyword.filter(lang=lang).first().label
266 changes: 1 addition & 265 deletions geonode/base/fixtures/initial_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -4852,269 +4852,5 @@
"fields": {
"name": "TOPBAR_MENU"
}
},
{
"model": "base.thesaurus",
"pk": 1,
"fields": {
"identifier": "inspire_themes",
"title": "GEMET - INSPIRE themes, version 1.0",
"date": "2018-05-23T10:25:56",
"description": "GEMET - INSPIRE themes, version 1.0",
"slug": "",
"about": "http://inspire.ec.europa.eu/theme",
"card_min": 1,
"card_max": 0,
"facet": true
}
},
{
"model": "base.thesaurus",
"pk": 4,
"fields": {
"identifier": "abc-all1",
"title": "Register of data of general interest",
"date": "2018-06-25",
"description": "Register of data of general interest",
"slug": "",
"about": "https://registry.geodati.gov.it/abc-all1",
"card_min": 0,
"card_max": 1,
"facet": true
}
},
{
"model": "base.thesaurus",
"pk": 6,
"fields": {
"identifier": "limitation_on_public_access",
"title": "Limitations on public access",
"date": "2020-10-22T13:21:33",
"description": "Limitations on public access",
"slug": "",
"about": "http://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess",
"card_min": 1,
"card_max": 1,
"facet": true
}
},
{
"model": "base.thesaurus",
"pk": 7,
"fields": {
"identifier": "limitation_on_public_access-2",
"title": "Conditions Applying To Access and Use",
"date": "2020-10-30T16:58:34",
"description": "Conditions Applying To Access and Use",
"slug": "",
"about": "http://inspire.ec.europa.eu/metadata-codelist/ConditionsApplyingToAccessAndUse",
"card_min": 0,
"card_max": -1,
"facet": true
}
},
{
"model": "base.thesaurus",
"pk": 8,
"fields": {
"identifier": "foo_name",
"title": "Mocked Title",
"date": "2018-05-23T10:25:56",
"description": "Mocked Title",
"slug": "abc",
"about": "http://inspire.ec.europa.eu/theme",
"card_min": 1,
"card_max": -1,
"facet": true
}
},
{
"model": "base.thesauruskeyword",
"pk": 1,
"fields": {
"about": "http://inspire.ec.europa.eu/theme/ad",
"alt_label": "ad",
"thesaurus": 1
}
},
{
"model": "base.thesauruskeyword",
"pk": 2,
"fields": {
"about": "http://inspire.ec.europa.eu/theme/au",
"alt_label": "au",
"thesaurus": 1
}
},
{
"model": "base.thesauruskeyword",
"pk": 3,
"fields": {
"about": "http://inspire.ec.europa.eu/theme/rs",
"alt_label": "rs",
"thesaurus": 1
}
},
{
"model": "base.thesauruskeyword",
"pk": 35,
"fields": {
"about": "http://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1a",
"alt_label": "public access limited according to Article 13(1)(a) of the INSPIRE Directive [ITA]",
"thesaurus": 6
}
},
{
"model": "base.thesauruskeyword",
"pk": 44,
"fields": {
"about": "http://inspire.ec.europa.eu/metadata-codelist/ConditionsApplyingToAccessAndUse/noConditionsApply",
"alt_label": "No condition applicable",
"thesaurus": 7
}
},
{
"model": "base.thesauruskeyword",
"pk": 45,
"fields": {
"about": "http://inspire.ec.europa.eu/metadata-codelist/ConditionsApplyingToAccessAndUse/conditionsUnknown",
"alt_label": "Unknown Conditions",
"thesaurus": 7
}
},
{
"model": "base.thesauruskeyword",
"pk": 100,
"fields": {
"about": "http://test.com",
"alt_label": "Protected sites",
"thesaurus": 8
}
},
{
"model": "base.thesauruskeywordlabel",
"pk": 1,
"fields": {
"lang": "en",
"label": "Addresses",
"keyword": 1
}
},
{
"model": "base.thesauruskeywordlabel",
"pk": 2,
"fields": {
"lang": "de",
"label": "Adressen",
"keyword": 1
}
},
{
"model": "base.thesauruskeywordlabel",
"pk": 3,
"fields": {
"lang": "en",
"label": "Administrative units",
"keyword": 2
}
},
{
"model": "base.thesauruskeywordlabel",
"pk": 4,
"fields": {
"lang": "en",
"label": "Coordinate reference systems",
"keyword": 3
}
},
{
"model": "base.thesauruskeywordlabel",
"pk": 36,
"fields": {
"lang": "en",
"label": "public access limited according to Article 13(1)(a) of the INSPIRE Directive",
"keyword": 35
}
},
{
"model": "base.thesauruskeywordlabel",
"pk": 54,
"fields": {
"lang": "en",
"label": "no conditions to access and use",
"keyword": 44
}
},
{
"model": "base.thesauruskeywordlabel",
"pk": 56,
"fields": {
"lang": "en",
"label": "conditions to access and use unknown",
"keyword": 45
}
},
{
"model": "base.thesauruskeywordlabel",
"pk": 102,
"fields": {
"lang": "en",
"label": "Protected sites",
"keyword": 100
}
},
{
"model": "base.thesauruslabel",
"pk": 1,
"fields": {
"lang": "en",
"label": "Addresses",
"thesaurus": 1
}
},
{
"model": "base.thesauruslabel",
"pk": 2,
"fields": {
"lang": "de",
"label": "Adressen",
"thesaurus": 1
}
},
{
"model": "base.thesauruslabel",
"pk": 4,
"fields": {
"lang": "en",
"label": "Register of the reference data sets",
"thesaurus": 4
}
},
{
"model": "base.thesauruslabel",
"pk": 5,
"fields": {
"lang": "en",
"label": "Limitations on public access",
"thesaurus": 6
}
},
{
"model": "base.thesauruslabel",
"pk": 7,
"fields": {
"lang": "en",
"label": "Conditions Applying To Access and Use",
"thesaurus": 7
}
},
{
"model": "base.thesauruslabel",
"pk": 9,
"fields": {
"lang": "en",
"label": "Register of the reference data sets",
"thesaurus": 8
}
}
}
]
Loading