localcosmos-server 0.24.8__py3-none-any.whl → 0.24.10__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -335,9 +335,13 @@ class TaxonRelationshipTaxonSerializer(serializers.Serializer):
335
335
  taxonAuthor = serializers.CharField(read_only=True)
336
336
  nameUuid = serializers.CharField(read_only=True)
337
337
  taxonNuid = serializers.CharField(read_only=True)
338
+ slug = serializers.CharField(read_only=True)
339
+ localizedSlug = serializers.DictField(child=serializers.CharField(read_only=True), read_only=True)
340
+ gbifNubkey = serializers.IntegerField(read_only=True, allow_null=True)
338
341
  image = ImageSerializer(read_only=True)
339
342
  vernacular = serializers.DictField(child=serializers.CharField(read_only=True), read_only=True)
340
343
  hasTaxonProfile = serializers.BooleanField(read_only=True)
344
+ shortProfile = serializers.CharField(allow_null=True, required=False, read_only=True)
341
345
  taxonProfileId = serializers.IntegerField(read_only=True, allow_null=True)
342
346
 
343
347
  def __init__(self, *args, app=None, **kwargs):
@@ -354,7 +358,7 @@ class TaxonRelationshipTaxonSerializer(serializers.Serializer):
354
358
  if localized_taxon_profiles_path:
355
359
  root = self.app.get_installed_app_path('published')
356
360
  taxon_profile_path = os.path.join(root, localized_taxon_profiles_path.lstrip('/'), instance['taxonSource'], instance['nameUuid'] + '.json')
357
- print(taxon_profile_path)
361
+
358
362
  if os.path.isfile(taxon_profile_path):
359
363
  with open(taxon_profile_path, 'r', encoding='utf-8') as f:
360
364
  taxon_profile = json.load(f)
@@ -368,8 +372,10 @@ class TaxonRelationshipTaxonSerializer(serializers.Serializer):
368
372
 
369
373
  if taxon_profile:
370
374
  taxon['taxonProfileId'] = taxon_profile['taxonProfileId']
375
+ taxon['vernacular'] = taxon_profile['vernacular']
371
376
  else:
372
377
  taxon['taxonProfileId'] = None
378
+ taxon['vernacular'] = {}
373
379
 
374
380
  return taxon
375
381
 
@@ -75,8 +75,11 @@ function ajaxify(container_id){
75
75
  var contentType = 'application/x-www-form-urlencoded; charset=UTF-8';
76
76
  var processData = true;
77
77
  }
78
-
79
- submit_button.attr('disabled','disabled');
78
+
79
+ // only disable button if it has not the class nodisable
80
+ if (!submit_button.hasClass('nodisable')) {
81
+ submit_button.attr('disabled','disabled');
82
+ }
80
83
 
81
84
  $.ajax({
82
85
  type: form.attr('method'),
@@ -3,7 +3,7 @@ from django.utils.translation import gettext_lazy as _
3
3
 
4
4
  from localcosmos_server.taxonomy.lazy import LazyAppTaxon
5
5
 
6
- from localcosmos_server.taxonomy.widgets import (TaxonAutocompleteWidget, SelectTaxonWidget, ListToLazyTaxon)
6
+ from localcosmos_server.taxonomy.widgets import (TaxonAutocompleteWidget, SelectTaxonWidget, HiddenTaxonWidget, ListToLazyTaxon)
7
7
 
8
8
  '''
9
9
  A field that returns a LazyTaxon instance
@@ -100,3 +100,24 @@ class SelectTaxonField(LazyTaxonField, forms.MultiValueField):
100
100
 
101
101
  super().__init__(fields, *args, require_all_fields=True, **kwargs)
102
102
 
103
+
104
+
105
+ class HiddenTaxonField(LazyTaxonField, forms.MultiValueField):
106
+
107
+ lazy_taxon_class = LazyAppTaxon
108
+
109
+ def __init__(self, *args, **kwargs):
110
+
111
+ include_descendants = kwargs.pop('include_descendants', False)
112
+
113
+ self.widget = HiddenTaxonWidget(include_descendants=include_descendants)
114
+
115
+ fields = [
116
+ forms.CharField(), # taxon_source
117
+ forms.CharField(), # taxon_latname
118
+ forms.CharField(required=False), # taxon_author
119
+ forms.CharField(), # name_uuid
120
+ forms.CharField(), # taxon_nuid
121
+ ]
122
+
123
+ super().__init__(fields, *args, require_all_fields=True, **kwargs)
@@ -216,3 +216,26 @@ class SelectTaxonWidget(ListToLazyTaxon, MultiWidget):
216
216
  value = self.get_lazy_taxon(value)
217
217
  return value
218
218
 
219
+
220
+
221
+ class HiddenTaxonWidget(MultiWidget):
222
+ def __init__(self, attrs=None, include_descendants=False):
223
+ widgets = [
224
+ HiddenInput(), # taxon_source
225
+ HiddenInput(), # taxon_latname
226
+ HiddenInput(), # taxon_author
227
+ HiddenInput(), # name_uuid
228
+ HiddenInput(), # taxon_nuid
229
+ ]
230
+ if include_descendants:
231
+ widgets.append(HiddenInput()) # include_descendants
232
+ super().__init__(widgets, attrs)
233
+
234
+ def decompress(self, lazy_taxon):
235
+
236
+ if lazy_taxon:
237
+ data_list = [lazy_taxon.taxon_source, lazy_taxon.taxon_latname, lazy_taxon.taxon_author,
238
+ str(lazy_taxon.name_uuid), lazy_taxon.taxon_nuid]
239
+ return data_list
240
+
241
+ return []
@@ -71,13 +71,13 @@ class LocalizedTemplateContentSerializer(serializers.ModelSerializer):
71
71
  return localized_template_content.published_author
72
72
 
73
73
  def get_createdAt(self, localized_template_content):
74
- return localized_template_content.created_at
74
+ return localized_template_content.created_at.isoformat()
75
75
 
76
76
  def get_lastModified(self, localized_template_content):
77
- return localized_template_content.updated_at
77
+ return localized_template_content.last_modified.isoformat()
78
78
 
79
79
  def get_publishedAt(self, localized_template_content):
80
- return localized_template_content.published_at
80
+ return localized_template_content.published_at.isoformat()
81
81
 
82
82
  def get_templateName(self, localized_template_content):
83
83
  return self.get_from_definition(localized_template_content, 'templateName')
@@ -0,0 +1,23 @@
1
+ # Generated by Django 5.1.7 on 2025-11-19 08:34
2
+
3
+ from django.db import migrations, models
4
+
5
+
6
+ class Migration(migrations.Migration):
7
+
8
+ dependencies = [
9
+ ('template_content', '0003_alter_templatecontent_template_type'),
10
+ ]
11
+
12
+ operations = [
13
+ migrations.AddField(
14
+ model_name='localizedtemplatecontent',
15
+ name='author',
16
+ field=models.CharField(blank=True, help_text="Author name for attribution (e.g., 'Dr. Jane Smith' or 'LocalCosmos Team')", max_length=355, null=True),
17
+ ),
18
+ migrations.AddField(
19
+ model_name='localizedtemplatecontent',
20
+ name='published_author',
21
+ field=models.CharField(blank=True, max_length=355, null=True),
22
+ ),
23
+ ]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: localcosmos_server
3
- Version: 0.24.8
3
+ Version: 0.24.10
4
4
  Summary: LocalCosmos Private Server. Run your own server for localcosmos.org apps.
5
5
  Home-page: https://github.com/SiSol-Systems/localcosmos-server
6
6
  Author: Thomas Uher
@@ -37,7 +37,7 @@ localcosmos_server/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3
37
37
  localcosmos_server/api/anycluster_schema_urls.py,sha256=nVa9-1pf6a1F-LNYaN3im9xy9LkebIxp0eaJs-Bwvok,1219
38
38
  localcosmos_server/api/examples.py,sha256=o9MyhwcsOKUI1YstEKQ7bFHM5nrVjy873WQcH_OTL-s,309
39
39
  localcosmos_server/api/permissions.py,sha256=HLToMDOGIMYWsRbM1asgw5NUGz7ukABrqGLSJxZEaXI,1303
40
- localcosmos_server/api/serializers.py,sha256=WR8w-1W7HpRAp5n4W0QUI5vp4GTuZ74ck0G8E5F-fo4,22096
40
+ localcosmos_server/api/serializers.py,sha256=C7yZgyIBrJ9ZaVI2MSx-JpbrYVI5uL0NPdkuH2ty_cg,22487
41
41
  localcosmos_server/api/urls.py,sha256=YwGSsvIofYWMPuO1e69VEo2W6oOM6TWU4vrv_Z9DuRk,2282
42
42
  localcosmos_server/api/views.py,sha256=1RSz7r5fGs0VC1fmu0VAk6N6BZ3wncv3fxkOVmY3MOM,26686
43
43
  localcosmos_server/api/example_files/taxon_profile.json,sha256=SeWCnsAHQejKZoKxBVEelcETd3emYYkuDXjkvJFSUlU,4861
@@ -944,7 +944,7 @@ localcosmos_server/static/localcosmos_server/interactive-image-field/Interactive
944
944
  localcosmos_server/static/localcosmos_server/js/ajax_file_input.js,sha256=lF9gSbLwV0COAnTboWSQBws8BJGHnlnsOMzci-pDOW4,1239
945
945
  localcosmos_server/static/localcosmos_server/js/bootstrap3-typeahead.js,sha256=qL2G4PGoEFnnWHBa7FLLDgkv7SWWTUViAIbgdML9HQ4,22466
946
946
  localcosmos_server/static/localcosmos_server/js/django-ajax-csrf.js,sha256=y6yRBzfURudBpPMwaPmL1UbPRyLVHp7Oh3EJBSL8BzQ,1570
947
- localcosmos_server/static/localcosmos_server/js/django-ajax.js,sha256=Vgyx6q0WdnP549IpQXSpcCc_j-kApVpsGOT9MpDkf_8,2176
947
+ localcosmos_server/static/localcosmos_server/js/django-ajax.js,sha256=-MgCdL2r-pC30_SLAGfSTuIwBqXdSy9wGSzMC1tOzIw,2288
948
948
  localcosmos_server/static/localcosmos_server/js/jquery-datasettaxon-autocomplete.js,sha256=ixTb5ItV5ktkiX1UNVbKVbRANJDeHdNAriutJtGm4qc,1172
949
949
  localcosmos_server/static/localcosmos_server/js/jquery-taxon-autocomplete.js,sha256=RPzfhK4Ncv_frrRyz1Phd1t_Uyy0ynovuK3eynM9jpc,3946
950
950
  localcosmos_server/static/localcosmos_server/js/jquery-user-autocomplete.js,sha256=Mg54Aesc-Uz-ZzKUgquLn-w2ulR6-nMb6fqPMEnP_F4,1006
@@ -2557,13 +2557,13 @@ localcosmos_server/static/phosphor-icons/youtube-logo.svg,sha256=fB9Vuc9r9KUVPOq
2557
2557
  localcosmos_server/taxonomy/AppTaxonSearch.py,sha256=OixiqMD9rASgLdpuW2I5ZqNLkCRjTdjFNNyd1CaEA34,5085
2558
2558
  localcosmos_server/taxonomy/TaxonManager.py,sha256=kc-T3edXw_kbw-guhEtF5Q00tL_WG636OtuuuCbupQA,11979
2559
2559
  localcosmos_server/taxonomy/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2560
- localcosmos_server/taxonomy/fields.py,sha256=UWoRSDq5C0wByECugDXs_Upz-GDsEirj2Fi9p9aDJz8,3045
2560
+ localcosmos_server/taxonomy/fields.py,sha256=7u_XYk3l-DK6Znoa1nAJshOJWBTfqbODOHeVFuhk1bM,3715
2561
2561
  localcosmos_server/taxonomy/forms.py,sha256=EvEGvbGAq8c0hwSO-FUdPiwODHNG1PjF5OKcZ9rAIv4,1602
2562
2562
  localcosmos_server/taxonomy/generic.py,sha256=xfDZr1eWTJZyy-5rLt07t45wfkIEWkr6soFshxzO5wc,7163
2563
2563
  localcosmos_server/taxonomy/lazy.py,sha256=kSZ-vmt36EE4n3-4Ad6_OXJcFKcDG90_f_KDDJooy1E,13575
2564
2564
  localcosmos_server/taxonomy/urls.py,sha256=HuAZJJrfltJpw3icjezG6aIHMYGbTidWPQzffzz7j_4,742
2565
2565
  localcosmos_server/taxonomy/views.py,sha256=tKHiYIaksj_aqaKHpx1nYoIIospgZhmrSyYm1wKy2RA,5524
2566
- localcosmos_server/taxonomy/widgets.py,sha256=Gv-6oLjXa0RyHq2osY4ZhEh6C6LlAWExPorqBSPX3-4,6570
2566
+ localcosmos_server/taxonomy/widgets.py,sha256=6WZhbKxyo5HXybwK0kPs2Yn33Vptz-wKGigdyL2Wl6U,7338
2567
2567
  localcosmos_server/template_content/Templates.py,sha256=lGKsQxjywy60nxvYz02Z5C618-H4H73XyGd2oxHx87Y,7296
2568
2568
  localcosmos_server/template_content/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2569
2569
  localcosmos_server/template_content/admin.py,sha256=suMo4x8I3JBxAFBVIdE-5qnqZ6JAZV0FESABHOSc-vg,63
@@ -2577,12 +2577,13 @@ localcosmos_server/template_content/utils.py,sha256=-qQQTwEiI9J2InPMGehidtgLK_6r
2577
2577
  localcosmos_server/template_content/views.py,sha256=QlCkPgvwjUn_4AAzwzPa_c6qfLY7Rcy9aV_EhZ9689k,37534
2578
2578
  localcosmos_server/template_content/widgets.py,sha256=iNQkktV_Fk7VZre-Jpy_tF03a7-PUL5XDVZ1YH5dNBQ,1775
2579
2579
  localcosmos_server/template_content/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2580
- localcosmos_server/template_content/api/serializers.py,sha256=FaRncSmm9Eo1TRLoMoJEhi-NA1ElXMyyb61o39gcwLw,12511
2580
+ localcosmos_server/template_content/api/serializers.py,sha256=5FI5wsw00lP96BZP9Ll45XNdXWscAs2J3zV0Mv4_mp0,12550
2581
2581
  localcosmos_server/template_content/api/urls.py,sha256=JPngLtzbQ0K2w3Wpq4O3RnvmSBCzTuNTcbIPkSO-QIE,893
2582
2582
  localcosmos_server/template_content/api/views.py,sha256=aVei450Ugi6XRrlssIzDkvthDzN5j2dqBYGEnwV9i2s,2538
2583
2583
  localcosmos_server/template_content/migrations/0001_initial.py,sha256=nABlB8A9ezsSXjYaYuv2Ks2gl8k3mB2Zwh8z0KDb1G8,3430
2584
2584
  localcosmos_server/template_content/migrations/0002_navigation_and_more.py,sha256=36xmQLxkUbWFfU3VRA27VkcVKzxqz7f_jQBUO1URwJo,4183
2585
2585
  localcosmos_server/template_content/migrations/0003_alter_templatecontent_template_type.py,sha256=8Vm_6KZuLiAE5npZ48rt84obb2S4Rq6ft_8fAcWdiNk,468
2586
+ localcosmos_server/template_content/migrations/0004_localizedtemplatecontent_author_and_more.py,sha256=-Qua4RUlwnej8UTCEgeN-Snhsd1_CQAdJta1WvX1eWY,743
2586
2587
  localcosmos_server/template_content/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2587
2588
  localcosmos_server/template_content/static/template_content/template_content.css,sha256=LIfhVPtjTAePXiuYlu1SDglqwFnUm_LdKpjwNto0w8c,1961
2588
2589
  localcosmos_server/template_content/static/template_content/template_content.js,sha256=h_FjRkBv_Qg8zvJ6wWbwshtzjXegdBkBfayNEardC1w,3081
@@ -2776,8 +2777,8 @@ localcosmos_server/tests/mixins.py,sha256=2k-zCrqndwQLABNULDWRftROij3kwhW_bTiV6r
2776
2777
  localcosmos_server/tests/test_forms.py,sha256=axF1v-T0NGR16St3hueQAuREb2sbWzajdNFQDpFeYqI,9767
2777
2778
  localcosmos_server/tests/test_models.py,sha256=h4d70Ps0hLbcgL6rL1OV_6zxJ_ewDfHgvzJTJDw1m6E,33000
2778
2779
  localcosmos_server/tests/test_views.py,sha256=SaEuAFAfapsSJi1_R6WEgp41MB03sPruCIy_hJ_oGwc,4308
2779
- localcosmos_server-0.24.8.dist-info/licenses/LICENCE,sha256=VnxALPSxXoU59rlNeRdJtwS_nU79IFpVWsZZCQUM4Mw,1086
2780
- localcosmos_server-0.24.8.dist-info/METADATA,sha256=FBEwZPRiQCBsAVyp5aM-Tw3nzJDfzTLzDBl8cOsIc6c,1686
2781
- localcosmos_server-0.24.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
2782
- localcosmos_server-0.24.8.dist-info/top_level.txt,sha256=hNVjlPGCtXvUF5CJY5HOFA_Dh5fYivfqVSyFMUDkqPY,19
2783
- localcosmos_server-0.24.8.dist-info/RECORD,,
2780
+ localcosmos_server-0.24.10.dist-info/licenses/LICENCE,sha256=VnxALPSxXoU59rlNeRdJtwS_nU79IFpVWsZZCQUM4Mw,1086
2781
+ localcosmos_server-0.24.10.dist-info/METADATA,sha256=FZb4xNyPq7Nl8thNctVuFRJlj8FlMGs6SHzCc4wr-1w,1687
2782
+ localcosmos_server-0.24.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
2783
+ localcosmos_server-0.24.10.dist-info/top_level.txt,sha256=hNVjlPGCtXvUF5CJY5HOFA_Dh5fYivfqVSyFMUDkqPY,19
2784
+ localcosmos_server-0.24.10.dist-info/RECORD,,