@@ -247,17 +247,25 @@ def create_collection(self, name, **kwargs):
247
247
248
248
return Collection (self , name , ** opts )
249
249
250
+ def _apply_incoming_manipulators (self , son , collection ):
251
+ for manipulator in self .__incoming_manipulators :
252
+ son = manipulator .transform_incoming (son , collection )
253
+ return son
254
+
255
+ def _apply_incoming_copying_manipulators (self , son , collection ):
256
+ for manipulator in self .__incoming_copying_manipulators :
257
+ son = manipulator .transform_incoming (son , collection )
258
+ return son
259
+
250
260
def _fix_incoming (self , son , collection ):
251
261
"""Apply manipulators to an incoming SON object before it gets stored.
252
262
253
263
:Parameters:
254
264
- `son`: the son object going into the database
255
265
- `collection`: the collection the son object is being saved in
256
266
"""
257
- for manipulator in self .__incoming_manipulators :
258
- son = manipulator .transform_incoming (son , collection )
259
- for manipulator in self .__incoming_copying_manipulators :
260
- son = manipulator .transform_incoming (son , collection )
267
+ son = self ._apply_incoming_manipulators (son , collection )
268
+ son = self ._apply_incoming_copying_manipulators (son , collection )
261
269
return son
262
270
263
271
def _fix_outgoing (self , son , collection ):
0 commit comments