localcosmos-app-kit 0.9.12__py3-none-any.whl → 0.9.13__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.
- app_kit/appbuilder/JSONBuilders/TaxonProfilesJSONBuilder.py +10 -0
- app_kit/appbuilder/JSONBuilders/__pycache__/TaxonProfilesJSONBuilder.cpython-313.pyc +0 -0
- app_kit/management/commands/export_all_nature_guides.py +14 -5
- {localcosmos_app_kit-0.9.12.dist-info → localcosmos_app_kit-0.9.13.dist-info}/METADATA +1 -1
- {localcosmos_app_kit-0.9.12.dist-info → localcosmos_app_kit-0.9.13.dist-info}/RECORD +8 -8
- {localcosmos_app_kit-0.9.12.dist-info → localcosmos_app_kit-0.9.13.dist-info}/WHEEL +0 -0
- {localcosmos_app_kit-0.9.12.dist-info → localcosmos_app_kit-0.9.13.dist-info}/licenses/LICENCE +0 -0
- {localcosmos_app_kit-0.9.12.dist-info → localcosmos_app_kit-0.9.13.dist-info}/top_level.txt +0 -0
|
@@ -566,6 +566,16 @@ class TaxonProfilesJSONBuilder(JSONBuilder):
|
|
|
566
566
|
taxon_json = self.app_release_builder.taxa_builder.serialize_taxon_extended(relationship.taxon)
|
|
567
567
|
related_taxon_json = self.app_release_builder.taxa_builder.serialize_taxon_extended(relationship.related_taxon)
|
|
568
568
|
|
|
569
|
+
if relationship.relationship_type.taxon_role == None and relationship.relationship_type.related_taxon_role == None:
|
|
570
|
+
# make 'taxon' the profile taxon
|
|
571
|
+
if relationship.taxon.taxon_nuid == profile_taxon.taxon_nuid:
|
|
572
|
+
pass
|
|
573
|
+
else:
|
|
574
|
+
# swap
|
|
575
|
+
temp = taxon_json
|
|
576
|
+
taxon_json = related_taxon_json
|
|
577
|
+
related_taxon_json = temp
|
|
578
|
+
|
|
569
579
|
relationship_json = {
|
|
570
580
|
'taxon': taxon_json,
|
|
571
581
|
'relatedTaxon': related_taxon_json,
|
|
Binary file
|
|
@@ -44,17 +44,26 @@ class Command(BaseCommand):
|
|
|
44
44
|
)
|
|
45
45
|
|
|
46
46
|
# Get all full filepaths of those images
|
|
47
|
-
image_filepaths =
|
|
47
|
+
image_filepaths = set() # Use set to avoid duplicates
|
|
48
48
|
for ci in content_images:
|
|
49
49
|
if ci.image_store and ci.image_store.source_image:
|
|
50
|
-
image_filepaths.
|
|
51
|
-
|
|
50
|
+
image_filepaths.add(ci.image_store.source_image.path)
|
|
51
|
+
|
|
52
|
+
# Also collect all ImageStore source_image paths
|
|
53
|
+
all_image_stores = ImageStore.objects.all()
|
|
54
|
+
for istore in all_image_stores:
|
|
55
|
+
if istore.source_image:
|
|
56
|
+
image_filepaths.add(istore.source_image.path)
|
|
57
|
+
|
|
52
58
|
# Zip all those images into a single zip file
|
|
53
59
|
zip_filename = os.path.join(export_path, f'nature_guides_images_{schema_name}.zip')
|
|
54
60
|
with zipfile.ZipFile(zip_filename, 'w') as zipf:
|
|
55
61
|
for filepath in image_filepaths:
|
|
56
|
-
|
|
57
|
-
|
|
62
|
+
if os.path.exists(filepath): # Add check to skip missing files
|
|
63
|
+
arcname = os.path.relpath(filepath, settings.MEDIA_ROOT)
|
|
64
|
+
zipf.write(filepath, arcname)
|
|
65
|
+
else:
|
|
66
|
+
self.stdout.write(f'Warning: Image file not found: {filepath}')
|
|
58
67
|
|
|
59
68
|
# Collect app labels and model names for dumpdata
|
|
60
69
|
models_to_export = [
|
|
@@ -52,7 +52,7 @@ app_kit/appbuilder/JSONBuilders/GlossaryJSONBuilder.py,sha256=7pITMctTmEVRbyb7Dl
|
|
|
52
52
|
app_kit/appbuilder/JSONBuilders/JSONBuilder.py,sha256=BssXm7ueXghCmHHmWsnQekQdbE4g0UIIQ59a6k0Bzts,6010
|
|
53
53
|
app_kit/appbuilder/JSONBuilders/MapJSONBuilder.py,sha256=NgP5g_H0sfq5VRkoHdMzkQUGLgUofcwG1R2xe6vUS9U,2792
|
|
54
54
|
app_kit/appbuilder/JSONBuilders/NatureGuideJSONBuilder.py,sha256=LZgyfc0e2xhTB9XES6fgm_vmL-O7VBBXsRdNDapgu5E,25498
|
|
55
|
-
app_kit/appbuilder/JSONBuilders/TaxonProfilesJSONBuilder.py,sha256=
|
|
55
|
+
app_kit/appbuilder/JSONBuilders/TaxonProfilesJSONBuilder.py,sha256=XNtRAQ31UPSghcFPUR1-RQLdzDpDxmkITb_paYP4uxQ,34716
|
|
56
56
|
app_kit/appbuilder/JSONBuilders/TemplateContentJSONBuilder.py,sha256=zWF7SNeRosbOi876boXp0tpIYXVs04fKtauK9Fr_DRs,7382
|
|
57
57
|
app_kit/appbuilder/JSONBuilders/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
58
58
|
app_kit/appbuilder/JSONBuilders/generic_forms_JSON_specification,sha256=dFabBHtkfzJqB2zNSRR2OaIyroYr1nEw_qY6VFZF7dQ,6720
|
|
@@ -74,7 +74,7 @@ app_kit/appbuilder/JSONBuilders/__pycache__/NatureGuideJSONBuilder.cpython-311.p
|
|
|
74
74
|
app_kit/appbuilder/JSONBuilders/__pycache__/NatureGuideJSONBuilder.cpython-313.pyc,sha256=jF5kdrd9eYsIuLJtophN4ptZB67MM1poI4Oao2aY8RU,25376
|
|
75
75
|
app_kit/appbuilder/JSONBuilders/__pycache__/TaxonJSONBuilder.cpython-311.pyc,sha256=nEt3jd6Pf4lb0QnFpU7QPg9bsKa68z0Vh8C85t4CMO0,9663
|
|
76
76
|
app_kit/appbuilder/JSONBuilders/__pycache__/TaxonProfilesJSONBuilder.cpython-311.pyc,sha256=bffiRE-WzCN3s0sz00rFuuu8c0qFL7kRq97XwtuRnoo,22862
|
|
77
|
-
app_kit/appbuilder/JSONBuilders/__pycache__/TaxonProfilesJSONBuilder.cpython-313.pyc,sha256
|
|
77
|
+
app_kit/appbuilder/JSONBuilders/__pycache__/TaxonProfilesJSONBuilder.cpython-313.pyc,sha256=--E2Ix4-WlvKe_BPIWLnqoNmEnkfWop0ZDn2FWJu1Ew,29536
|
|
78
78
|
app_kit/appbuilder/JSONBuilders/__pycache__/TemplateContentJSONBuilder.cpython-311.pyc,sha256=7fGagTetGK129h057h6dPXMSwggBX03uHOm3_dr3ueE,5932
|
|
79
79
|
app_kit/appbuilder/JSONBuilders/__pycache__/TemplateContentJSONBuilder.cpython-313.pyc,sha256=lXf1kZuOMRWsHmnP1aN7UJIPEfWF-PhiMyyZ9FfY1Tg,6501
|
|
80
80
|
app_kit/appbuilder/JSONBuilders/__pycache__/__init__.cpython-311.pyc,sha256=MxwSyVkGIkNVrjjMZzXCHh9k7_ytM6tzgpNTaCtDNn4,211
|
|
@@ -480,7 +480,7 @@ app_kit/locale/en/LC_MESSAGES/django.po,sha256=jhD_BqtvCqoH-3NeWsLZy9v4DJ3vGYt1U
|
|
|
480
480
|
app_kit/management/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
481
481
|
app_kit/management/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
482
482
|
app_kit/management/commands/create_app_kit.py,sha256=VeSBg2G0PbvZTTciIVJ_xkSzF_EfIYhvL0ZLmpouPHg,1204
|
|
483
|
-
app_kit/management/commands/export_all_nature_guides.py,sha256=
|
|
483
|
+
app_kit/management/commands/export_all_nature_guides.py,sha256=Q2QVp4uBzjgLQYSWS4HA8ckhVMFfsp-kZBp6YOZSLrs,4552
|
|
484
484
|
app_kit/management/commands/fix_nature_guide_trees.py,sha256=3WjcFIWly9rZtN0KFU4b4ZABQkAaPFE7UZciyN_QN7o,2973
|
|
485
485
|
app_kit/management/commands/import_all_nature_guides.py,sha256=gsb5em1IxWFyZv9-sslbOfEgiESmDUGapTUpwQsUevw,4309
|
|
486
486
|
app_kit/management/commands/migrate_apps_to_v1.py,sha256=DnXgtRs160UjpJiE75zElIxMT3CKfQfOoutX3d6aEwg,3276
|
|
@@ -1930,8 +1930,8 @@ app_kit/tests/__pycache__/test_models.cpython-313.pyc,sha256=Lmv3BfjLs5Fg-olJeMl
|
|
|
1930
1930
|
app_kit/tests/__pycache__/test_utils.cpython-313.pyc,sha256=GX3REqZygi2eO_A2F2_KtYi7hg54X5QPtCTCGWuxGpM,14054
|
|
1931
1931
|
app_kit/tests/__pycache__/test_views.cpython-311.pyc,sha256=NDJR40TcMm-bXXC-wV7OgH1sGR3N7psSWYiUirkkrjU,133242
|
|
1932
1932
|
app_kit/tests/__pycache__/test_views.cpython-313.pyc,sha256=q851UqIZFCCTfQb1lF4SVxV1j_Vu1hJdOlpckmrGX28,125363
|
|
1933
|
-
localcosmos_app_kit-0.9.
|
|
1934
|
-
localcosmos_app_kit-0.9.
|
|
1935
|
-
localcosmos_app_kit-0.9.
|
|
1936
|
-
localcosmos_app_kit-0.9.
|
|
1937
|
-
localcosmos_app_kit-0.9.
|
|
1933
|
+
localcosmos_app_kit-0.9.13.dist-info/licenses/LICENCE,sha256=VnxALPSxXoU59rlNeRdJtwS_nU79IFpVWsZZCQUM4Mw,1086
|
|
1934
|
+
localcosmos_app_kit-0.9.13.dist-info/METADATA,sha256=hg_K67TUbizhMbdhRqJhPuQRq4MCixNgrJLbCecQGXA,1388
|
|
1935
|
+
localcosmos_app_kit-0.9.13.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
1936
|
+
localcosmos_app_kit-0.9.13.dist-info/top_level.txt,sha256=F6H4pEBkCvUR_iwQHIy4K1iby-jzfWg3CTym5XJKeys,8
|
|
1937
|
+
localcosmos_app_kit-0.9.13.dist-info/RECORD,,
|
|
File without changes
|
{localcosmos_app_kit-0.9.12.dist-info → localcosmos_app_kit-0.9.13.dist-info}/licenses/LICENCE
RENAMED
|
File without changes
|
|
File without changes
|