Exemplo n.º 1
0
Arquivo: ming.py Projeto: chatid/depot
 def _check_object_deleted(self, obj):
     hist = self.get_depot_history(obj)
     if state(obj).status == ObjectState.deleted:
         for prop in mapper(obj).properties:
             if isinstance(prop, UploadedFileProperty):
                 current_value = prop.__get__(obj, obj.__class__)
                 hist.delete(current_value)
         self._flush_object(obj)
Exemplo n.º 2
0
 def _check_object_deleted(self, obj):
     hist = self.get_depot_history(obj)
     if state(obj).status == ObjectState.deleted:
         for prop in mapper(obj).properties:
             if isinstance(prop, UploadedFileProperty):
                 current_value = prop.__get__(obj, obj.__class__)
                 hist.delete(current_value)
         self._flush_object(obj)
Exemplo n.º 3
0
Arquivo: ming.py Projeto: chatid/depot
 def get_depot_history(cls, instance):
     istate = state(instance)
     if not hasattr(istate, '_depot_history'):
         istate._depot_history = _DepotHistory()
     return istate._depot_history
Exemplo n.º 4
0
 def get_depot_history(cls, instance):
     istate = state(instance)
     if not hasattr(istate, '_depot_history'):
         istate._depot_history = _DepotHistory()
     return istate._depot_history