def __call__(self): # strong guaranteed here doc = database.codernity_db.get('id', self.node.tag, with_doc=True) delivery_session = get_delivery_session(doc['delivery_session_id']) remain = doc['remain'] from lite_mms.apis import wraps finished_store_bill_list = [wraps(models.StoreBill.query.get(store_bill_id)) for store_bill_id in doc['finished_store_bill_id_list']] unfinished_store_bill = wraps(models.StoreBill.query.get(doc['unfinished_store_bill_id'])) is_finished = doc['is_last_task'] loader = models.User.query.get(doc['loader_id']) from lite_mms.portal.delivery_ws.webservices import create_delivery_task create_delivery_task(delivery_session, remain, finished_store_bill_list, unfinished_store_bill, loader, is_finished)
def get_or_404(cls, id_): from lite_mms.database import db from lite_mms.apis import ModelWrapper, wraps assert issubclass(cls, db.Model) or issubclass(cls, ModelWrapper) return wraps(cls.query.get_or_404(id_))
def __call__(self): # strong guaranteed here doc = database.codernity_db.get('id', self.node.tag, with_doc=True) delivery_session = get_delivery_session(doc['delivery_session_id']) remain = doc['remain'] from lite_mms.apis import wraps finished_store_bill_list = [ wraps(models.StoreBill.query.get(store_bill_id)) for store_bill_id in doc['finished_store_bill_id_list'] ] unfinished_store_bill = wraps( models.StoreBill.query.get(doc['unfinished_store_bill_id'])) is_finished = doc['is_last_task'] loader = models.User.query.get(doc['loader_id']) from lite_mms.portal.delivery_ws.webservices import create_delivery_task create_delivery_task(delivery_session, remain, finished_store_bill_list, unfinished_store_bill, loader, is_finished)
def annotation(self): from lite_mms.apis import wraps doc = database.codernity_db.get('id', self.node.tag, with_doc=True) remain = doc['remain'] unfinished_store_bill = wraps(models.StoreBill.query.get(doc['unfinished_store_bill_id'])) d = OrderedDict() d[u'剩余仓单编号'] = unfinished_store_bill.id d[u'仓单原重'] = unfinished_store_bill.weight d[u'产品'] = unfinished_store_bill.sub_order.product.name + '(%s:%s)' % (unfinished_store_bill.sub_order.spec or '?', unfinished_store_bill.sub_order.type or '?') d[u'客户'] = unfinished_store_bill.sub_order.customer.name d[u'剩余重量'] = str(remain) + u'(公斤)' return d
def annotation(self): from lite_mms.apis import wraps doc = database.codernity_db.get('id', self.node.tag, with_doc=True) remain = doc['remain'] unfinished_store_bill = wraps( models.StoreBill.query.get(doc['unfinished_store_bill_id'])) d = OrderedDict() d[u'剩余仓单编号'] = unfinished_store_bill.id d[u'仓单原重'] = unfinished_store_bill.weight d[u'产品'] = unfinished_store_bill.sub_order.product.name + '(%s:%s)' % ( unfinished_store_bill.sub_order.spec or '?', unfinished_store_bill.sub_order.type or '?') d[u'客户'] = unfinished_store_bill.sub_order.customer.name d[u'剩余重量'] = str(remain) + u'(公斤)' return d
def scaffold_list(self, models): return [wraps(obj) for obj in models]
def _(step, gr): from lite_mms.apis import wraps assert wraps(gr).stale
def op(self, obj): wraps(obj).go(actor_id=current_user.id, action=constants.work_command.ACT_RETRIEVAL)
def scaffold_list(self, models): return [wraps(obj) for obj in models]
def scaffold_list(self, objs): return [wraps(obj) for obj in objs]
def _(step, gr): from lite_mms.apis import wraps assert wraps(gr).stale
def scaffold_list(self, objs): return [wraps(obj) for obj in objs]
def op(self, obj): wraps(obj).go(actor_id=current_user.id, action=constants.work_command.ACT_RETRIEVAL)