コード例 #1
0
def update_configuration(logger, box_configuration):
    """ method updates box configuration in the MongoDB"""
    w_number = CollectionContext.get_w_number(logger, COLLECTION_BOX_CONFIGURATION)
    collection = CollectionContext.get_collection(logger, COLLECTION_BOX_CONFIGURATION)
    collection.save(box_configuration.get_document(), safe=True, w=w_number)
コード例 #2
0
def remove(logger, uow_id):
    w_number = CollectionContext.get_w_number(logger, COLLECTION_UNITS_OF_WORK)
    collection = CollectionContext.get_collection(logger, COLLECTION_UNITS_OF_WORK)
    collection.remove(uow_id, safe=True, w=w_number)
コード例 #3
0
def insert(logger, unit_of_work):
    """ inserts unit of work to MongoDB. @throws DuplicateKeyError is such record already exists """
    w_number = CollectionContext.get_w_number(logger, COLLECTION_UNITS_OF_WORK)
    collection = CollectionContext.get_collection(logger, COLLECTION_UNITS_OF_WORK)
    uow_id = collection.insert(unit_of_work.get_document(), safe=True, w=w_number)
    return uow_id
コード例 #4
0
def update(logger, unit_of_work):
    """ method finds unit_of_work record and change its status"""
    w_number = CollectionContext.get_w_number(logger, COLLECTION_UNITS_OF_WORK)
    collection = CollectionContext.get_collection(logger, COLLECTION_UNITS_OF_WORK)
    collection.save(unit_of_work.get_document(), safe=True, w=w_number)
コード例 #5
0
ファイル: time_table.py プロジェクト: strategist922/scheduler
 def _save_time_record(self, process_name, time_record):
     collection = self._get_timetable_collection(process_name)
     w_number = CollectionContext.get_w_number(self.logger, COLLECTION_TIMETABLE_YEARLY)
     return collection.save(time_record.get_document(), safe=True, w=w_number)
コード例 #6
0
def update(logger, scheduler_configuration):
    """ method finds scheduler_configuration record and update its DB representation"""
    w_number = CollectionContext.get_w_number(logger, COLLECTION_SCHEDULER_CONFIGURATION)
    collection = CollectionContext.get_collection(logger, COLLECTION_SCHEDULER_CONFIGURATION)
    collection.save(scheduler_configuration.get_document(), safe=True, w=w_number)