1818#########################################################################
1919
2020from django .contrib import admin
21- from django .db .models import Prefetch
2221
2322from modeltranslation .admin import TabbedTranslationAdmin
2423
2524from geonode .base .admin import ResourceBaseAdminForm
2625from geonode .layers .models import Dataset , Attribute , Style
2726from geonode .base .admin import metadata_batch_edit
2827
29- from geonode .base .fields import MultiThesauriField
30- from geonode .base .models import ThesaurusKeyword , ThesaurusKeywordLabel
31-
32- from dal import autocomplete
33-
3428
3529class AttributeInline (admin .TabularInline ):
3630 model = Attribute
@@ -41,21 +35,9 @@ class Meta(ResourceBaseAdminForm.Meta):
4135 model = Dataset
4236 fields = "__all__"
4337
44- tkeywords = MultiThesauriField (
45- queryset = ThesaurusKeyword .objects .prefetch_related (
46- Prefetch ("keyword" , queryset = ThesaurusKeywordLabel .objects .filter (lang = "en" ))
47- ),
48- widget = autocomplete .ModelSelect2Multiple (
49- url = "thesaurus_autocomplete" ,
50- ),
51- label = ("Keywords from Thesaurus" ),
52- required = False ,
53- help_text = ("List of keywords from Thesaurus" ,),
54- )
55-
5638
5739class DatasetAdmin (TabbedTranslationAdmin ):
58- exclude = ("ll_bbox_polygon" , "bbox_polygon" , "srid" )
40+ exclude = ("ll_bbox_polygon" , "bbox_polygon" , "srid" , "tkeywords" )
5941 list_display = (
6042 "id" ,
6143 "alternate" ,
0 commit comments