本文整理汇总了Python中models.user.User.super_leaders方法的典型用法代码示例。如果您正苦于以下问题:Python User.super_leaders方法的具体用法?Python User.super_leaders怎么用?Python User.super_leaders使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.user.User
的用法示例。
在下文中一共展示了User.super_leaders方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: apply_pay
# 需要导入模块: from models.user import User [as 别名]
# 或者: from models.user.User import super_leaders [as 别名]
def apply_pay(invoice_id):
medium_invoice = searchAdMediumInvoice.get(invoice_id)
if not medium_invoice:
abort(404)
invoice_pay_ids = request.values.getlist('invoices')
invoice_pays = searchAdMediumInvoicePay.gets(invoice_pay_ids)
if not invoice_pays:
abort(403)
emails = request.values.getlist('email')
msg = request.values.get('msg', '')
action = int(request.values.get('action', 0))
to_users = [g.user] + User.medias() + User.media_leaders() + User.super_leaders()
to_emails = list(set(emails + [x.email for x in to_users]))
if action == 2:
action_msg = u'媒体订单打款申请'
for invoice in invoice_pays:
invoice.pay_status = MEDIUM_INVOICE_STATUS_APPLY
invoice.save()
flash(u'[%s媒体申请打款,打款金额: %s, 发票号: %s] %s ' %
(invoice.medium_invoice.company, invoice.money,
invoice.medium_invoice.invoice_num, invoice.detail), 'success')
invoice.medium_invoice.client_order.add_comment(g.user, u"%s,%s" % (
action_msg, u' %s媒体申请打款,打款金额: %s, 发票号: %s %s ' %
(invoice.medium_invoice.company, invoice.money,
invoice.medium_invoice.invoice_num, invoice.detail)), msg_channel=3)
send_type = "saler"
elif action == 3:
action_msg = u'同意媒体订单打款申请,请财务打款'
to_emails += [k.email for k in User.finances()]
for invoice in invoice_pays:
invoice.pay_status = MEDIUM_INVOICE_STATUS_AGREE
invoice.save()
flash(u' 同意%s媒体订单打款申请,打款金额: %s, 发票号: %s %s ' %
(invoice.medium_invoice.company, invoice.money,
invoice.medium_invoice.invoice_num, invoice.detail), 'success')
invoice.medium_invoice.client_order.add_comment(g.user, u"%s,%s" % (
action_msg, u' %s媒体同意打款,打款金额: %s, 发票号: %s %s ' %
(invoice.medium_invoice.company, invoice.money,
invoice.medium_invoice.invoice_num, invoice.detail)), msg_channel=3)
send_type = "finance"
else:
action_msg = u'消息提醒'
apply_context = {"to_other": emails,
"title": action_msg,
"to": to_emails,
"action_msg": action_msg,
"msg": msg,
"invoice": medium_invoice,
"send_type": send_type,
"invoice_pays": invoice_pays}
medium_invoice_apply_signal.send(
current_app._get_current_object(), apply_context=apply_context)
flash(u'[%s 打款发票开具申请] 已发送邮件给 %s ' %
(medium_invoice.client_order, ', '.join(to_emails)), 'info')
return redirect(url_for('searchAd_saler_client_order_medium_invoice.invoice', invoice_id=invoice_id))
示例2: invoice_pass
# 需要导入模块: from models.user import User [as 别名]
# 或者: from models.user.User import super_leaders [as 别名]
def invoice_pass(invoice_id):
if not g.user.is_finance():
abort(404)
invoice = MediumInvoice.get(invoice_id)
if not invoice:
abort(404)
invoices_ids = request.values.getlist('invoices')
invoices_pay = MediumInvoicePay.gets(invoices_ids)
if not invoices_pay:
abort(403)
emails = request.values.getlist('email')
msg = request.values.get('msg', '')
action = int(request.values.get('action', 0))
to_users = [g.user] + \
User.medias() + User.media_leaders() + User.super_leaders()
to_emails = list(set(emails + [x.email for x in to_users]))
if action != 10:
invoice_status = MEDIUM_INVOICE_STATUS_PASS
action_msg = u'媒体款项已打款'
for invoice_pay in invoices_pay:
invoice_pay.pay_status = invoice_status
invoice_pay.save()
flash(u'媒体订单款已打,名称:%s, 付款金额%s' % (
invoice_pay.medium_invoice.client_order.name +
'-' + invoice_pay.medium_invoice.medium.name,
str(invoice_pay.money)), 'success')
invoice_pay.medium_invoice.client_order.add_comment(
g.user, u'媒体订单款已付款,名称%s, 付款金额%s ' % (
invoice_pay.medium_invoice.client_order.name +
'-' + invoice_pay.medium_invoice.medium.name,
str(invoice_pay.money)),
msg_channel=3)
else:
action_msg = u'消息提醒'
context = {"to_users": to_users,
"action": 0,
"action_msg": action_msg,
"info": msg,
"invoice": invoice,
"order": invoice.client_order,
"send_type": 'end',
"invoice_pays": invoices_pay}
medium_invoice_apply_signal.send(
current_app._get_current_object(), context=context)
flash(u'已发送邮件给 %s ' % (', '.join(to_emails)), 'info')
return redirect(url_for("finance_client_order_medium_pay.pay_info", invoice_id=invoice_id))
示例3: apply_invoice
# 需要导入模块: from models.user import User [as 别名]
# 或者: from models.user.User import super_leaders [as 别名]
def apply_invoice(invoice_id):
invoice = MediumInvoice.get(invoice_id)
if not invoice:
abort(404)
invoices_ids = request.values.getlist('invoices')
invoices = MediumInvoice.gets(invoices_ids)
if not invoices:
abort(403)
emails = request.values.getlist('email')
msg = request.values.get('msg', '')
action = int(request.values.get('action', 0))
to_users = [g.user] + User.medias() + User.media_leaders() + \
User.super_leaders()
to_emails = list(set(emails + [x.email for x in to_users]))
send_type = "saler"
if action == 2:
invoice_status = MEDIUM_INVOICE_STATUS_APPLY
action_msg = u'打款发票开具申请'
if action != 10:
for invoice in invoices:
invoice.invoice_status = invoice_status
invoice.save()
flash(u' %s 打款发票申请,发票金额: %s, 发票号: %s %s ' %
(invoice.company, invoice.money, invoice.invoice_num, action_msg), 'success')
invoice.client_order.add_comment(g.user, u"%s,%s" % (
action_msg, u'打款发票内容: %s; 发票金额: %s元; 发票号: %s' %
(invoice.detail, str(invoice.money), invoice.invoice_num)), msg_channel=3)
else:
action_msg = u'消息提醒'
apply_context = {"sender": g.user,
"to_other": emails,
"title": action_msg,
"to": to_emails,
"action_msg": action_msg,
"msg": msg,
"order": invoice.client_order,
"send_type": send_type,
"invoices": invoices}
medium_invoice_apply_signal.send(
current_app._get_current_object(), apply_context=apply_context)
flash(u'[%s 打款发票开具申请] 已发送邮件给 %s ' %
(invoice.client_order, ', '.join(to_emails)), 'info')
return redirect(url_for("saler_client_order_medium_invoice.index", order_id=invoice.client_order.id))
示例4: pass_invoice
# 需要导入模块: from models.user import User [as 别名]
# 或者: from models.user.User import super_leaders [as 别名]
def pass_invoice(invoice_id):
if not g.user.is_finance():
abort(404)
invoice = MediumRebateInvoice.get(invoice_id)
if not invoice:
abort(404)
invoices_ids = request.values.getlist('invoices')
invoices = MediumRebateInvoice.gets(invoices_ids)
if not invoices:
abort(403)
emails = request.values.getlist('email')
msg = request.values.get('msg', '')
action = int(request.values.get('action', 0))
to_users = User.medias() + User.media_leaders() + User.super_leaders()
if action != 10:
invoice_status = INVOICE_STATUS_PASS
action_msg = u'媒体返点发票已开'
for invoice in invoices:
invoice.invoice_status = invoice_status
invoice.create_time = datetime.date.today()
invoice.save()
flash(u'[%s 发票已开,发票金额%s] %s ' %
(invoice.company, invoice.money, action_msg), 'success')
invoice.client_order.add_comment(g.user, u"%s,%s" % (
action_msg, u'发票内容: %s; 发票金额: %s元' % (invoice.detail, str(invoice.money))), msg_channel=6)
else:
action_msg = u'消息提醒'
context = {"to_users": to_users,
"to_other": emails,
"action_msg": action_msg,
"action": 0,
"info": msg,
"order": invoice.client_order,
"send_type": 'end',
"invoices": invoices
}
medium_rebate_invoice_apply_signal.send(
current_app._get_current_object(), context=context)
return redirect(url_for("finance_client_order_medium_rebate_invoice.info", order_id=invoice.client_order.id))
示例5: leaders
# 需要导入模块: from models.user import User [as 别名]
# 或者: from models.user.User import super_leaders [as 别名]
def leaders(self):
return list(set([l for u in self.sales + self.replace_sales
for l in u.user_leaders] + User.super_leaders()))
示例6: apply_pay
# 需要导入模块: from models.user import User [as 别名]
# 或者: from models.user.User import super_leaders [as 别名]
def apply_pay(invoice_id):
medium_invoice = MediumInvoice.get(invoice_id)
if not medium_invoice:
abort(404)
invoice_pay_ids = request.values.getlist('invoices')
invoice_pays = MediumInvoicePay.gets(invoice_pay_ids)
if not invoice_pays:
abort(403)
emails = request.values.getlist('email')
msg = request.values.get('msg', '')
action = int(request.values.get('action', 0))
to_users = [g.user] + User.medias() + User.media_leaders() + \
User.super_leaders()
if action == 2:
action_msg = u'媒体打款申请'
for invoice in invoice_pays:
invoice.pay_status = MEDIUM_INVOICE_STATUS_APPLY
invoice.save()
flash(u'[%s媒体申请打款,打款金额: %s, 发票号: %s] %s ' %
(invoice.medium_invoice.company, invoice.money,
invoice.medium_invoice.invoice_num, invoice.detail), 'success')
invoice.medium_invoice.client_order.add_comment(g.user, u"%s,%s" % (
action_msg, u' %s媒体申请打款,打款金额: %s, 发票号: %s %s ' %
(invoice.medium_invoice.company, invoice.money,
invoice.medium_invoice.invoice_num, invoice.detail)), msg_channel=3)
send_type = "saler"
elif action == 3:
action_msg = u'媒体打款申请'
for invoice in invoice_pays:
invoice.pay_status = MEDIUM_INVOICE_STATUS_F_AGREE
invoice.save()
flash(u'[副总裁同意%s媒体打款,打款金额: %s, 发票号: %s] %s ' %
(invoice.medium_invoice.company, invoice.money,
invoice.medium_invoice.invoice_num, invoice.detail), 'success')
invoice.medium_invoice.client_order.add_comment(g.user, u"%s,%s" % (
action_msg, u' 副总裁同意%s媒体打款,打款金额: %s, 发票号: %s %s ' %
(invoice.medium_invoice.company, invoice.money,
invoice.medium_invoice.invoice_num, invoice.detail)), msg_channel=3)
send_type = "saler"
elif action == 4:
action_msg = u'黄亮已批准媒体打款'
to_users += User.finances()
for invoice in invoice_pays:
invoice.pay_status = MEDIUM_INVOICE_STATUS_AGREE
invoice.save()
flash(u' 同意%s媒体订单打款申请,打款金额: %s, 发票号: %s %s ' %
(invoice.medium_invoice.company, invoice.money,
invoice.medium_invoice.invoice_num, invoice.detail), 'success')
invoice.medium_invoice.client_order.add_comment(g.user, u"%s,%s" % (
action_msg, u' %s媒体同意打款,打款金额: %s, 发票号: %s %s ' %
(invoice.medium_invoice.company, invoice.money,
invoice.medium_invoice.invoice_num, invoice.detail)), msg_channel=3)
send_type = "finance"
else:
action_msg = u'消息提醒'
context = {"to_users": to_users,
"action": action,
"to_other": emails,
"action_msg": action_msg,
"info": msg,
"invoice": medium_invoice,
"order": medium_invoice.client_order,
"send_type": send_type,
"invoice_pays": invoice_pays}
medium_invoice_apply_signal.send(
current_app._get_current_object(), context=context)
return redirect(url_for('saler_client_order_medium_invoice.invoice', invoice_id=invoice_id))