本文整理匯總了Python中webnotes.model.doclist.DocList.from_compressed方法的典型用法代碼示例。如果您正苦於以下問題:Python DocList.from_compressed方法的具體用法?Python DocList.from_compressed怎麽用?Python DocList.from_compressed使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類webnotes.model.doclist.DocList
的用法示例。
在下文中一共展示了DocList.from_compressed方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: savedocs
# 需要導入模塊: from webnotes.model.doclist import DocList [as 別名]
# 或者: from webnotes.model.doclist.DocList import from_compressed [as 別名]
def savedocs():
"""save / submit / cancel / update doclist"""
try:
from webnotes.model.doclist import DocList
form = webnotes.form_dict
doclist = DocList()
doclist.from_compressed(form.get('docs'), form.get('docname'))
# action
action = form.get('action')
if action=='Update': action='update_after_submit'
getattr(doclist, action.lower())()
# update recent documents
webnotes.user.update_recent(doclist.doc.doctype, doclist.doc.name)
# send updated docs
webnotes.response['saved'] = '1'
webnotes.response['main_doc_name'] = doclist.doc.name
webnotes.response['docname'] = doclist.doc.name
webnotes.response['docs'] = [doclist.doc] + doclist.children
except Exception, e:
webnotes.msgprint('Did not save')
webnotes.errprint(webnotes.utils.getTraceback())
raise e
示例2: runserverobj
# 需要導入模塊: from webnotes.model.doclist import DocList [as 別名]
# 或者: from webnotes.model.doclist.DocList import from_compressed [as 別名]
def runserverobj():
"""
Run server objects
"""
import webnotes.model.code
from webnotes.model.doclist import DocList
from webnotes.utils import cint
form = webnotes.form
doclist = None
method = form.getvalue('method')
arg = form.getvalue('arg')
dt = form.getvalue('doctype')
dn = form.getvalue('docname')
if dt: # not called from a doctype (from a page)
if not dn: dn = dt # single
so = webnotes.model.code.get_obj(dt, dn)
else:
doclist = DocList()
doclist.from_compressed(form.getvalue('docs'), dn)
so = doclist.make_obj()
doclist.check_if_latest()
check_guest_access(so.doc)
if so:
r = webnotes.model.code.run_server_obj(so, method, arg)
if r:
#build output as csv
if cint(webnotes.form.getvalue('as_csv')):
make_csv_output(r, so.doc.doctype)
else:
webnotes.response['message'] = r
webnotes.response['docs'] =[so.doc] + so.doclist