Skip to content

Commit be81f2b

Browse files
committed
This is totally unwanted and doesn't match mongodb provider behaviour
1 parent 89df6b5 commit be81f2b

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

sprox/sa/provider.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -591,23 +591,6 @@ def _modify_params_for_dates(self, entity, params):
591591
params[key] = dt
592592
return params
593593

594-
def _remove_related_empty_params(self, obj, params, omit_fields=None):
595-
entity = obj.__class__
596-
mapper = class_mapper(entity)
597-
relations = self.get_relations(entity)
598-
for relation in relations:
599-
if omit_fields and relation in omit_fields:
600-
continue
601-
602-
#clear out those items which are not found in the params list.
603-
if relation not in params or not params[relation]:
604-
related_items = getattr(obj, relation)
605-
if related_items is not None:
606-
if hasattr(related_items, '__iter__'):
607-
setattr(obj, relation, [])
608-
else:
609-
setattr(obj, relation, None)
610-
611594
def _get_obj(self, entity, pkdict):
612595
entity = resolve_entity(entity)
613596
pk_names = self.get_primary_fields(entity)
@@ -636,7 +619,6 @@ def update(self, entity, params, omit_fields=None):
636619
pass
637620
setattr(obj, key, value)
638621

639-
self._remove_related_empty_params(obj, params, omit_fields)
640622
self.session.flush()
641623
return obj
642624

0 commit comments

Comments
 (0)