udata 9.0.1.dev29431__py2.py3-none-any.whl → 9.0.1.dev29468__py2.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.

Potentially problematic release.


This version of udata might be problematic. Click here for more details.

@@ -0,0 +1,35 @@
1
+ '''
2
+ Add a default topic to all reuses in db
3
+ '''
4
+ import logging
5
+
6
+ from bson import DBRef
7
+ import mongoengine
8
+
9
+ from udata.models import Reuse
10
+
11
+ log = logging.getLogger(__name__)
12
+
13
+
14
+ def migrate(db):
15
+ log.info('Processing Reuse.')
16
+
17
+ reuses = Reuse.objects().no_cache().timeout(False)
18
+ count = 0
19
+ errors = 0
20
+
21
+ for reuse in reuses:
22
+ datasets_ids = []
23
+ for dataset in reuse.datasets:
24
+ if not isinstance(dataset, DBRef):
25
+ datasets_ids.append(dataset.id)
26
+ else:
27
+ errors += 1
28
+
29
+ if len(datasets_ids) != len(reuse.datasets):
30
+ reuse.datasets = datasets_ids
31
+ reuse.save()
32
+ count += 1
33
+
34
+ log.info(f'Modified {count} Reuses objects (removed {errors} datasets)')
35
+ log.info('Done')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: udata
3
- Version: 9.0.1.dev29431
3
+ Version: 9.0.1.dev29468
4
4
  Summary: Open data portal
5
5
  Home-page: https://github.com/opendatateam/udata
6
6
  Author: Opendata Team
@@ -138,6 +138,7 @@ It is collectively taken care of by members of the
138
138
  ## Current (in progress)
139
139
 
140
140
  - Refactor catalog exports [#3052](https://github.com/opendatateam/udata/pull/3052)
141
+ - Fix reuses' datasets references [#3057](https://github.com/opendatateam/udata/pull/3057)
141
142
  - Save and show harvest logs [#3053](https://github.com/opendatateam/udata/pull/3053)
142
143
 
143
144
  ## 9.0.0 (2024-06-07)
@@ -336,6 +336,7 @@ udata/migrations/2022-10-10-migrate-harvest-extras.py,sha256=HyBy7f1epYuBry68lUY
336
336
  udata/migrations/2023-02-08-rename-internal-dates.py,sha256=AYewRwdVCfHsJ5APbhQWfihH-nerT3jOzQsSrXW9RQ0,1651
337
337
  udata/migrations/2024-01-29-fix-reuse-and-dataset-with-private-None.py,sha256=173Zf67G-oJgLwXeQUpzoCzcpAOu1ifcLb4eUMJ9nfU,590
338
338
  udata/migrations/2024-03-22-migrate-activity-kwargs-to-extras.py,sha256=n5-udd1IdaD-e3q5cZx9nC4uMUSyJyT1TkI6I4gFgh0,400
339
+ udata/migrations/2024-06-11-fix-reuse-datasets-references.py,sha256=qeJMoOpW46AA80Eoh5Br5a-E6ol6O-eqgwFWJt5XqF0,786
339
340
  udata/migrations/__init__.py,sha256=3YP8ppVG5Jx_u6fWJ099X6m3JDYsbd_wetpu4arl6_U,10882
340
341
  udata/models/__init__.py,sha256=RNv3-9A3ARWgKYYBJv-lJNvakPR3JLiuZ6722-CO6Kc,1288
341
342
  udata/mongo/__init__.py,sha256=_ubmmhJuo6_fpuoMPEAat9Pv-5K_8rDbUuXmhe62zvU,1419
@@ -684,9 +685,9 @@ udata/translations/pt/LC_MESSAGES/udata.mo,sha256=uttB2K8VsqzkEQG-5HfTtFms_3LtV9
684
685
  udata/translations/pt/LC_MESSAGES/udata.po,sha256=8Ql1Lp7Z9KLnvp-qRxw-NhFu1p35Xj-q6Jg9JHsYhcw,43733
685
686
  udata/translations/sr/LC_MESSAGES/udata.mo,sha256=US8beNIMPxP5h-zD_jfP1TheDDd4DdRVS5UIiY5XVZ8,28553
686
687
  udata/translations/sr/LC_MESSAGES/udata.po,sha256=TM0yMDvKRljyOzgZZMlTX6OfpF6OC4Ngf_9Zc8n6ayA,50313
687
- udata-9.0.1.dev29431.dist-info/LICENSE,sha256=V8j_M8nAz8PvAOZQocyRDX7keai8UJ9skgmnwqETmdY,34520
688
- udata-9.0.1.dev29431.dist-info/METADATA,sha256=tH5DttpiRj30EDSXXLaIGv1j_CWf4ivtED37VvcNHic,124183
689
- udata-9.0.1.dev29431.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
690
- udata-9.0.1.dev29431.dist-info/entry_points.txt,sha256=3SKiqVy4HUqxf6iWspgMqH8d88Htk6KoLbG1BU-UddQ,451
691
- udata-9.0.1.dev29431.dist-info/top_level.txt,sha256=39OCg-VWFWOq4gCKnjKNu-s3OwFlZIu_dVH8Gl6ndHw,12
692
- udata-9.0.1.dev29431.dist-info/RECORD,,
688
+ udata-9.0.1.dev29468.dist-info/LICENSE,sha256=V8j_M8nAz8PvAOZQocyRDX7keai8UJ9skgmnwqETmdY,34520
689
+ udata-9.0.1.dev29468.dist-info/METADATA,sha256=eUDNQF9Yl-zU7kLY9aCI32D0i3m3rIMjrBH53m_I6BE,124274
690
+ udata-9.0.1.dev29468.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
691
+ udata-9.0.1.dev29468.dist-info/entry_points.txt,sha256=3SKiqVy4HUqxf6iWspgMqH8d88Htk6KoLbG1BU-UddQ,451
692
+ udata-9.0.1.dev29468.dist-info/top_level.txt,sha256=39OCg-VWFWOq4gCKnjKNu-s3OwFlZIu_dVH8Gl6ndHw,12
693
+ udata-9.0.1.dev29468.dist-info/RECORD,,