• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python webnotes.errprint函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中webnotes.errprint函数的典型用法代码示例。如果您正苦于以下问题:Python errprint函数的具体用法?Python errprint怎么用?Python errprint使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了errprint函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: send

	def send(self):
		"""
			* Execute get method
			* Send email to recipients
		"""
		if not self.doc.recipient_list: return

		self.sending = True
		result, email_body = self.get()
		
		recipient_list = self.doc.recipient_list.split("\n")

		# before sending, check if user is disabled or not
		# do not send if disabled
		profile_list = webnotes.conn.sql("SELECT name, enabled FROM tabProfile", as_dict=1)
		for profile in profile_list:
			if profile['name'] in recipient_list and profile['enabled'] == 0:
				del recipient_list[recipient_list.index(profile['name'])]

		from webnotes.utils.email_lib import sendmail
		try:
			#webnotes.msgprint('in send')
			sendmail(
				recipients=recipient_list,
				sender='[email protected]',
				reply_to='[email protected]',
				subject=self.doc.frequency + ' Digest',
				msg=email_body,
				from_defs=1
			)
		except Exception, e:
			webnotes.msgprint('There was a problem in sending your email. Please contact [email protected]')
			webnotes.errprint(webnotes.getTraceback())
开发者ID:antoxin,项目名称:erpnext,代码行数:33,代码来源:email_digest.py


示例2: sql

	def sql(self, query, values=(), as_dict = 0, as_list = 0, formatted = 0, 
		debug=0, ignore_ddl=0, as_utf8=0, auto_commit=0, update=None):
		"""
		      * Execute a `query`, with given `values`
		      * returns as a dictionary if as_dict = 1
		      * returns as a list of lists (with cleaned up dates) if as_list = 1
		"""
		# in transaction validations
		self.check_transaction_status(query)
		
		# autocommit
		if auto_commit and self.in_transaction: self.commit()
		if auto_commit: self.begin()
			
		# execute
		try:
			if values!=():
				if isinstance(values, dict):
					values = dict(values)
				if debug: webnotes.errprint(query % values)
				self._cursor.execute(query, values)
				
			else:
				if debug: webnotes.errprint(query)
				self._cursor.execute(query)	
		except Exception, e:
			# ignore data definition errors
			if ignore_ddl and e.args[0] in (1146,1054,1091):
				pass
			else:
				raise e
开发者ID:gowrav-vishwakarma,项目名称:wnframework,代码行数:31,代码来源:db.py


示例3: getdoc

def getdoc(doctype, name, user=None):
	"""
	Loads a doclist for a given document. This method is called directly from the client.
	Requries "doctype", "name" as form variables.
	Will also call the "onload" method on the document.
	"""

	import webnotes
	
	if not (doctype and name):
		raise Exception, 'doctype and name required!'
	
	if not name: 
		name = doctype

	if not webnotes.conn.exists(doctype, name):
		return []

	try:
		bean = webnotes.bean(doctype, name)
		bean.run_method("onload")

		doclist = bean.doclist

		# add file list
		set_docinfo(doctype, name)
		
	except Exception, e:
		webnotes.errprint(webnotes.utils.getTraceback())
		webnotes.msgprint('Did not load.')
		raise e
开发者ID:Yellowen,项目名称:wnframework,代码行数:31,代码来源:load.py


示例4: get_events

def get_events(start, end, doctype,op,filters=None):
        webnotes.errprint(['hello',doctype, op])
        cnd =''
        if op:
                cnd = "and encounter = '%(pros)s'"%{"pros":op}

        from webnotes.widgets.reportview import build_match_conditions
        #if not webnotes.has_permission("Task"):
        #        webnotes.msgprint(_("No Permission"), raise_exception=1)
        conditions = ''
        # conditions = build_match_conditions("Patient Encounter Entry")
        # conditions and (" and " + conditions) or ""
        
        if filters:
                filters = json.loads(filters)
                for key in filters:
                        if filters[key]:
                                conditions += " and " + key + ' = "' + filters[key].replace('"', '\"') + '"'
        
        data = webnotes.conn.sql("""select name, start_time, end_time, 
                study, status,encounter from `tabPatient Encounter Entry`
                where  ((start_time between '%(start)s' and '%(end)s') \
                        or (end_time between '%(start)s' and '%(end)s')) %(cnd)s 
                %(conditions)s""" % {
                        "start": start,
                        "end": end,
                        "conditions": conditions,
                        "cnd":cnd
                }, as_dict=True, update={"allDay": 0},debug=1)

        return data
开发者ID:saurabh6790,项目名称:alert-med-app,代码行数:31,代码来源:patient_encounter_entry.py


示例5: on_update

        def on_update(self):
                patient_id = None
                from datetime import datetime

                if self.doc.status == 'Canceled':
                        webnotes.conn.sql("update `tabPatient Encounter Entry` set docstatus = '1' where name = '%s'"%(self.doc.name))

                s1=(self.doc.start_time).split(':')
                s2=(self.doc.end_time).split(':')
                # date_a=cstr(datetime.combine(datetime.strptime(self.doc.encounter_date,'%Y-%m-%d').date(),datetime.strptime(s1[0]+":"+s1[1],'%H:%M').time()))
                # date_b=cstr(datetime.combine(datetime.strptime(self.doc.encounter_date,'%Y-%m-%d').date(),datetime.strptime(s2[0]+":"+s2[1],'%H:%M').time()))
                #webnotes.errprint(self.doc.entry_in_child)
                if self.doc.new_user == 1 and not self.doc.new_patient:
                        patient_id = self.make_patient()
                        self.doc.new_patient=patient_id
                        self.create_new_contact()
                        self.create_customer(patient_id)
                        self.create_account_head(patient_id)
                        self.doc.save()
                if self.doc.entry_in_child == 'False':
                        self.make_child_entry(patient_id)
                        #self.make_event()

                if not self.doc.eventid:
                        self.create_child()
                else:
                        webnotes.conn.sql("update `tabSlot Child` set slot='"+self.doc.appointment_slot+"', start_time='"+cstr(datetime.strptime(date_a,'%Y-%m-%d %H:%M:%S').strftime('%Y-%m-%d %H:%M'))+"', end_time='"+cstr(datetime.strptime(date_b,'%Y-%m-%d %H:%M:%S').strftime('%Y-%m-%d %H:%M'))+"' where encounter='"+self.doc.name+"'")
                        webnotes.errprint(date_a)
                        webnotes.conn.sql("update `tabEvent` set starts_on='"+cstr(datetime.strptime(date_a,'%Y-%m-%d %H:%M:%S').strftime('%Y-%m-%d %H:%M'))+"', ends_on='"+cstr(datetime.strptime(date_b,'%Y-%m-%d %H:%M:%S').strftime('%Y-%m-%d %H:%M'))+"' where name='"+self.doc.eventid+"'",debug=1)

                if cint(self.doc.checked_in)==1: pass
开发者ID:saurabh6790,项目名称:alert-med-app,代码行数:31,代码来源:patient_encounter_entry.py


示例6: create_receiver_list

 def create_receiver_list(self):
   rec, where_clause = '', ''   
   if self.doc.cus == 'All Customer Contact':
     where_clause = self.doc.customer and " and customer = '%s'" % self.doc.customer or " and ifnull(is_customer, 0) = 1"
   if self.doc.cus == 'All Supplier Contact':
     where_clause = self.doc.supplier and "  and supplier = '%s'" % self.doc.supplier or " and ifnull(is_supplier, 0) = 1"
   if self.doc.cus == 'All Sales Partner Contact':
     where_clause = self.doc.sales_partner and "  and sales_partner = '%s'" % self.doc.sales_partner or " and ifnull(is_sales_partner, 0) = 1"
   if self.doc.cus in ['All Customer Contact', 'All Supplier Contact', 'All Sales Partner Contact']:
     rec = sql("select CONCAT(ifnull(first_name,''),' ',ifnull(last_name,'')), mobile_no from `tabContact` where ifnull(mobile_no,'')!='' and docstatus != 2 %s" % where_clause)
   elif self.doc.cus == 'All Lead (Open)':
     rec = sql("select lead_name, mobile_no from tabLead where ifnull(mobile_no,'')!='' and docstatus != 2 and status = 'Open'")
   elif self.doc.cus == 'All Employee (Active)':
     where_clause = self.doc.department and " and department = '%s'" % self.doc.department or ""
     where_clause += self.doc.branch and " and branch = '%s'" % self.doc.branch or ""
     rec = sql("select employee_name, cell_number from `tabEmployee` where status = 'Active' and docstatus < 2 and ifnull(cell_number,'')!='' %s" % where_clause)
   elif self.doc.cus == 'All Sales Person':
     rec = sql("select sales_person_name, mobile_no from `tabSales Person` where docstatus != 2 and ifnull(mobile_no,'')!=''")
   elif self.doc.cus == 'All Contact':
     rec = sql("select first_name,mobile_no from `tabContact` where ifnull(mobile_no,'')!=''")
   else:
     rec=sql("select cont_name,ph_no from `tabSub Contact` where parent='"+self.doc.cus+"'")
   rec_list = ''
   for d in rec:
     rec_list += d[0] + ' - ' + d[1] + '\n'
   self.doc.receiver_list = rec_list
   webnotes.errprint(rec_list)
开发者ID:rohitw1991,项目名称:latestadberp,代码行数:27,代码来源:sms_center.py



注:本文中的webnotes.errprint函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python webnotes.getTraceback函数代码示例发布时间:2022-05-26
下一篇:
Python webnotes.doclist函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap