morango 0.8.3__tar.gz → 0.8.4__tar.gz

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 morango might be problematic. Click here for more details.

Files changed (94) hide show
  1. {morango-0.8.3 → morango-0.8.4}/CHANGELOG.md +3 -0
  2. {morango-0.8.3 → morango-0.8.4}/PKG-INFO +1 -1
  3. morango-0.8.4/morango/__init__.py +1 -0
  4. {morango-0.8.3 → morango-0.8.4}/morango/models/core.py +6 -1
  5. {morango-0.8.3 → morango-0.8.4}/morango/registry.py +22 -15
  6. {morango-0.8.3 → morango-0.8.4}/morango/sync/operations.py +1 -1
  7. {morango-0.8.3 → morango-0.8.4}/morango.egg-info/PKG-INFO +1 -1
  8. morango-0.8.4/requirements/dev.txt +2 -0
  9. morango-0.8.3/morango/__init__.py +0 -1
  10. morango-0.8.3/requirements/dev.txt +0 -3
  11. {morango-0.8.3 → morango-0.8.4}/AUTHORS.md +0 -0
  12. {morango-0.8.3 → morango-0.8.4}/LICENSE +0 -0
  13. {morango-0.8.3 → morango-0.8.4}/MANIFEST.in +0 -0
  14. {morango-0.8.3 → morango-0.8.4}/README.md +0 -0
  15. {morango-0.8.3 → morango-0.8.4}/morango/api/__init__.py +0 -0
  16. {morango-0.8.3 → morango-0.8.4}/morango/api/fields.py +0 -0
  17. {morango-0.8.3 → morango-0.8.4}/morango/api/parsers.py +0 -0
  18. {morango-0.8.3 → morango-0.8.4}/morango/api/permissions.py +0 -0
  19. {morango-0.8.3 → morango-0.8.4}/morango/api/serializers.py +0 -0
  20. {morango-0.8.3 → morango-0.8.4}/morango/api/urls.py +0 -0
  21. {morango-0.8.3 → morango-0.8.4}/morango/api/viewsets.py +0 -0
  22. {morango-0.8.3 → morango-0.8.4}/morango/apps.py +0 -0
  23. {morango-0.8.3 → morango-0.8.4}/morango/constants/__init__.py +0 -0
  24. {morango-0.8.3 → morango-0.8.4}/morango/constants/api_urls.py +0 -0
  25. {morango-0.8.3 → morango-0.8.4}/morango/constants/capabilities.py +0 -0
  26. {morango-0.8.3 → morango-0.8.4}/morango/constants/settings.py +0 -0
  27. {morango-0.8.3 → morango-0.8.4}/morango/constants/transfer_stages.py +0 -0
  28. {morango-0.8.3 → morango-0.8.4}/morango/constants/transfer_statuses.py +0 -0
  29. {morango-0.8.3 → morango-0.8.4}/morango/errors.py +0 -0
  30. {morango-0.8.3 → morango-0.8.4}/morango/management/__init__.py +0 -0
  31. {morango-0.8.3 → morango-0.8.4}/morango/management/commands/__init__.py +0 -0
  32. {morango-0.8.3 → morango-0.8.4}/morango/management/commands/cleanupsyncs.py +0 -0
  33. {morango-0.8.3 → morango-0.8.4}/morango/migrations/0001_initial.py +0 -0
  34. {morango-0.8.3 → morango-0.8.4}/morango/migrations/0001_squashed_0024_auto_20240129_1757.py +0 -0
  35. {morango-0.8.3 → morango-0.8.4}/morango/migrations/0002_auto_20170511_0400.py +0 -0
  36. {morango-0.8.3 → morango-0.8.4}/morango/migrations/0002_store_idx_morango_deserialize.py +0 -0
  37. {morango-0.8.3 → morango-0.8.4}/morango/migrations/0003_auto_20170519_0543.py +0 -0
  38. {morango-0.8.3 → morango-0.8.4}/morango/migrations/0004_auto_20170520_2112.py +0 -0
  39. {morango-0.8.3 → morango-0.8.4}/morango/migrations/0005_auto_20170629_2139.py +0 -0
  40. {morango-0.8.3 → morango-0.8.4}/morango/migrations/0006_instanceidmodel_system_id.py +0 -0
  41. {morango-0.8.3 → morango-0.8.4}/morango/migrations/0007_auto_20171018_1615.py +0 -0
  42. {morango-0.8.3 → morango-0.8.4}/morango/migrations/0008_auto_20171114_2217.py +0 -0
  43. {morango-0.8.3 → morango-0.8.4}/morango/migrations/0009_auto_20171205_0252.py +0 -0
  44. {morango-0.8.3 → morango-0.8.4}/morango/migrations/0010_auto_20171206_1615.py +0 -0
  45. {morango-0.8.3 → morango-0.8.4}/morango/migrations/0011_sharedkey.py +0 -0
  46. {morango-0.8.3 → morango-0.8.4}/morango/migrations/0012_auto_20180927_1658.py +0 -0
  47. {morango-0.8.3 → morango-0.8.4}/morango/migrations/0013_auto_20190627_1513.py +0 -0
  48. {morango-0.8.3 → morango-0.8.4}/morango/migrations/0014_syncsession_extra_fields.py +0 -0
  49. {morango-0.8.3 → morango-0.8.4}/morango/migrations/0015_auto_20200508_2104.py +0 -0
  50. {morango-0.8.3 → morango-0.8.4}/morango/migrations/0016_store_deserialization_error.py +0 -0
  51. {morango-0.8.3 → morango-0.8.4}/morango/migrations/0017_store_last_transfer_session_id.py +0 -0
  52. {morango-0.8.3 → morango-0.8.4}/morango/migrations/0018_auto_20210714_2216.py +0 -0
  53. {morango-0.8.3 → morango-0.8.4}/morango/migrations/0019_auto_20220113_1807.py +0 -0
  54. {morango-0.8.3 → morango-0.8.4}/morango/migrations/0020_postgres_fix_nullable.py +0 -0
  55. {morango-0.8.3 → morango-0.8.4}/morango/migrations/0021_store_partition_index_create.py +0 -0
  56. {morango-0.8.3 → morango-0.8.4}/morango/migrations/0022_rename_instance_fields.py +0 -0
  57. {morango-0.8.3 → morango-0.8.4}/morango/migrations/0023_add_instance_id_fields.py +0 -0
  58. {morango-0.8.3 → morango-0.8.4}/morango/migrations/0024_auto_20240129_1757.py +0 -0
  59. {morango-0.8.3 → morango-0.8.4}/morango/migrations/__init__.py +0 -0
  60. {morango-0.8.3 → morango-0.8.4}/morango/models/__init__.py +0 -0
  61. {morango-0.8.3 → morango-0.8.4}/morango/models/certificates.py +0 -0
  62. {morango-0.8.3 → morango-0.8.4}/morango/models/fields/__init__.py +0 -0
  63. {morango-0.8.3 → morango-0.8.4}/morango/models/fields/crypto.py +0 -0
  64. {morango-0.8.3 → morango-0.8.4}/morango/models/fields/uuids.py +0 -0
  65. {morango-0.8.3 → morango-0.8.4}/morango/models/fsic_utils.py +0 -0
  66. {morango-0.8.3 → morango-0.8.4}/morango/models/manager.py +0 -0
  67. {morango-0.8.3 → morango-0.8.4}/morango/models/query.py +0 -0
  68. {morango-0.8.3 → morango-0.8.4}/morango/models/signals.py +0 -0
  69. {morango-0.8.3 → morango-0.8.4}/morango/models/utils.py +0 -0
  70. {morango-0.8.3 → morango-0.8.4}/morango/proquint.py +0 -0
  71. {morango-0.8.3 → morango-0.8.4}/morango/sync/__init__.py +0 -0
  72. {morango-0.8.3 → morango-0.8.4}/morango/sync/backends/__init__.py +0 -0
  73. {morango-0.8.3 → morango-0.8.4}/morango/sync/backends/base.py +0 -0
  74. {morango-0.8.3 → morango-0.8.4}/morango/sync/backends/postgres.py +0 -0
  75. {morango-0.8.3 → morango-0.8.4}/morango/sync/backends/sqlite.py +0 -0
  76. {morango-0.8.3 → morango-0.8.4}/morango/sync/backends/utils.py +0 -0
  77. {morango-0.8.3 → morango-0.8.4}/morango/sync/context.py +0 -0
  78. {morango-0.8.3 → morango-0.8.4}/morango/sync/controller.py +0 -0
  79. {morango-0.8.3 → morango-0.8.4}/morango/sync/session.py +0 -0
  80. {morango-0.8.3 → morango-0.8.4}/morango/sync/syncsession.py +0 -0
  81. {morango-0.8.3 → morango-0.8.4}/morango/sync/utils.py +0 -0
  82. {morango-0.8.3 → morango-0.8.4}/morango/urls.py +0 -0
  83. {morango-0.8.3 → morango-0.8.4}/morango/utils.py +0 -0
  84. {morango-0.8.3 → morango-0.8.4}/morango.egg-info/SOURCES.txt +0 -0
  85. {morango-0.8.3 → morango-0.8.4}/morango.egg-info/dependency_links.txt +0 -0
  86. {morango-0.8.3 → morango-0.8.4}/morango.egg-info/not-zip-safe +0 -0
  87. {morango-0.8.3 → morango-0.8.4}/morango.egg-info/requires.txt +0 -0
  88. {morango-0.8.3 → morango-0.8.4}/morango.egg-info/top_level.txt +0 -0
  89. {morango-0.8.3 → morango-0.8.4}/requirements/accelerated.txt +0 -0
  90. {morango-0.8.3 → morango-0.8.4}/requirements/docs.txt +0 -0
  91. {morango-0.8.3 → morango-0.8.4}/requirements/postgres.txt +0 -0
  92. {morango-0.8.3 → morango-0.8.4}/requirements/test.txt +0 -0
  93. {morango-0.8.3 → morango-0.8.4}/setup.cfg +0 -0
  94. {morango-0.8.3 → morango-0.8.4}/setup.py +0 -0
@@ -2,6 +2,9 @@
2
2
 
3
3
  List of the most important changes for each release.
4
4
 
5
+ ## 0.8.4
6
+ - Adds syncable_objects model manager to use by default for all syncing operations, to allow default objects to be overridden
7
+
5
8
  ## 0.8.3
6
9
  - Adds error handling in the case that an incompatible cffi version is used in with Python 3.13
7
10
  - Update Python rsa package dependency to 4.9
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: morango
3
- Version: 0.8.3
3
+ Version: 0.8.4
4
4
  Summary: Pure Python sqlite-based Django DB replication engine.
5
5
  Home-page: https://github.com/learningequality/morango
6
6
  Author: Learning Equality
@@ -0,0 +1 @@
1
+ __version__ = "0.8.4"
@@ -473,7 +473,7 @@ class Store(AbstractStore):
473
473
  # imports core models.
474
474
  from morango.sync.utils import mute_signals
475
475
  with mute_signals(signals.post_delete):
476
- klass_model.objects.filter(id=self.id).delete()
476
+ klass_model.syncing_objects.filter(id=self.id).delete()
477
477
  return None, deferred_fks
478
478
  else:
479
479
  # load model into memory
@@ -806,6 +806,11 @@ class SyncableModel(UUIDModelMixin):
806
806
 
807
807
  objects = SyncableModelManager()
808
808
 
809
+ # Add a special syncing_objects queryset to every SyncableModel for use in syncing operations.
810
+ # This means that we still deal with the entire set of objects when syncing, even if the default
811
+ # model manager has been overridden to filter the queryset.
812
+ syncing_objects = SyncableModelManager()
813
+
809
814
  class Meta:
810
815
  abstract = True
811
816
 
@@ -35,6 +35,24 @@ def _multiple_self_ref_fk_check(class_model):
35
35
  return False
36
36
 
37
37
 
38
+ def _check_manager(name, objects):
39
+ from morango.models.manager import SyncableModelManager
40
+ from morango.models.query import SyncableModelQuerySet
41
+ # syncable model checks
42
+ if not isinstance(objects, SyncableModelManager):
43
+ raise InvalidMorangoModelConfiguration(
44
+ "Manager for {} must inherit from SyncableModelManager.".format(
45
+ name
46
+ )
47
+ )
48
+ if not isinstance(objects.none(), SyncableModelQuerySet):
49
+ raise InvalidMorangoModelConfiguration(
50
+ "Queryset for {} model must inherit from SyncableModelQuerySet.".format(
51
+ name
52
+ )
53
+ )
54
+
55
+
38
56
  class SyncableModelRegistry(object):
39
57
  def __init__(self):
40
58
  self.profile_models = {}
@@ -98,8 +116,6 @@ class SyncableModelRegistry(object):
98
116
 
99
117
  import django.apps
100
118
  from morango.models.core import SyncableModel
101
- from morango.models.manager import SyncableModelManager
102
- from morango.models.query import SyncableModelQuerySet
103
119
 
104
120
  model_list = []
105
121
  for model in django.apps.apps.get_models():
@@ -110,19 +126,10 @@ class SyncableModelRegistry(object):
110
126
  raise InvalidMorangoModelConfiguration(
111
127
  "Syncing models with more than 1 self referential ForeignKey is not supported."
112
128
  )
113
- # syncable model checks
114
- if not isinstance(model.objects, SyncableModelManager):
115
- raise InvalidMorangoModelConfiguration(
116
- "Manager for {} must inherit from SyncableModelManager.".format(
117
- name
118
- )
119
- )
120
- if not isinstance(model.objects.none(), SyncableModelQuerySet):
121
- raise InvalidMorangoModelConfiguration(
122
- "Queryset for {} model must inherit from SyncableModelQuerySet.".format(
123
- name
124
- )
125
- )
129
+ # Check both the objects and the syncing_objects querysets.
130
+ _check_manager(name, model.objects)
131
+ _check_manager(name, model.syncing_objects)
132
+
126
133
  if model._meta.many_to_many:
127
134
  raise UnsupportedFieldType(
128
135
  "{} model with a ManyToManyField is not supported in morango."
@@ -145,7 +145,7 @@ def _serialize_into_store(profile, filter=None):
145
145
  for model in syncable_models.get_models(profile):
146
146
  new_store_records = []
147
147
  new_rmc_records = []
148
- klass_queryset = model.objects.filter(_morango_dirty_bit=True)
148
+ klass_queryset = model.syncing_objects.filter(_morango_dirty_bit=True)
149
149
  if prefix_condition:
150
150
  klass_queryset = klass_queryset.filter(prefix_condition)
151
151
  store_records_dict = Store.objects.in_bulk(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: morango
3
- Version: 0.8.3
3
+ Version: 0.8.4
4
4
  Summary: Pure Python sqlite-based Django DB replication engine.
5
5
  Home-page: https://github.com/learningequality/morango
6
6
  Author: Learning Equality
@@ -0,0 +1,2 @@
1
+ pre-commit==4.1.0
2
+ tox==3.14.6
@@ -1 +0,0 @@
1
- __version__ = "0.8.3"
@@ -1,3 +0,0 @@
1
- flake8==2.6.0
2
- pre-commit==1.15.1
3
- tox==3.14.6
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes