当前位置: 首页>>代码示例>>Python>>正文


Python User.contracts方法代码示例

本文整理汇总了Python中models.user.User.contracts方法的典型用法代码示例。如果您正苦于以下问题:Python User.contracts方法的具体用法?Python User.contracts怎么用?Python User.contracts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在models.user.User的用法示例。


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

示例1: back_money_apply

# 需要导入模块: from models.user import User [as 别名]
# 或者: from models.user.User import contracts [as 别名]
def back_money_apply(sender, apply_context):
    order = apply_context['order']
    num = apply_context['num']
    type = apply_context['type']
    if type == 'invoice':
        s_title = u'项目回款信息-返点发票信息'
    elif type == 'end':
        s_title = u'项目回款完成'
    elif type == 'no_end':
        s_title = u'回款状态变为未完成'
    else:
        s_title = u'项目回款信息'
    if num == -1:
        s_title = u'坏账项目'
    if order.__tablename__ in ['searchAd_bra_client_order', 'searchAd_bra_rebate_order']:
        to_users = order.direct_sales + order.agent_sales + \
            [order.creator, g.user] + order.leaders
    else:
        to_users = order.direct_sales + order.agent_sales + User.contracts() + \
            [order.creator, g.user] + order.leaders + User.medias()
        if 3 in order.locations:
            to_users += [k for k in User.all()
                         if k.email.find('chenjingjing') >= 0]
        if 1 in order.locations:
            to_users += [k for k in User.all()
                         if k.email.find('weizhaoting') >= 0]

    if order.__tablename__ == 'bra_client_order':
        title = u"【新媒体订单-合同流程】- %s" % (order.name)
    elif order.__tablename__ == 'bra_client_medium_order':
        title = u"【直签媒体订单-合同流程】- %s" % (order.name)
    elif order.__tablename__ == 'bra_framework_order':
        title = u"【框架订单-合同流程】- %s" % (order.name)
    elif order.__tablename__ == 'bra_douban_order':
        title = u"【直签豆瓣订单-合同流程】- %s" % (order.name)
    elif order.__tablename__ == 'searchAd_bra_client_order':
        title = u"【效果业务普通订单-合同流程】- %s" % (order.name)
    elif order.__tablename__ == 'bra_searchAd_framework_order':
        title = u"【效果业务框架订单-合同流程】- %s" % (order.name)
    elif order.__tablename__ == 'searchad_bra_rebate_order':
        title = u"【效果业务返点订单-合同流程】- %s" % (order.name)
    else:
        title = u"【合同流程】- %s" % (order.name)

    url = mail.app.config['DOMAIN'] + order.info_path()
    body = u"""
<h3 style="color:red;">流程状态: %s

回款详情:
本次回款金额: %s
已回款完成比例: %s %%
订单链接地址: %s</h3>
<p><h4>订单信息:</h4>
%s</p>
<p>by %s</p>
""" % (s_title, str(num), order.back_money_percent, url, order.email_info, g.user.name)
    flash(u'已发送邮件给%s' % (','.join(_get_active_user_name(to_users))), 'info')
    _insert_person_notcie(to_users, title, body)
    send_html_mail(title, recipients=_get_active_user_email(
        to_users), body=body.replace('\n', '<br/>'))
开发者ID:giveme168,项目名称:braavos,代码行数:62,代码来源:email_signals.py

示例2: contract_apply_douban

# 需要导入模块: from models.user import User [as 别名]
# 或者: from models.user.User import contracts [as 别名]
def contract_apply_douban(sender, apply_context):
    """豆瓣直签豆瓣、关联豆瓣订单 发送豆瓣合同管理员"""
    order = apply_context['order']
    file_paths = []
    if order.get_last_contract():
        file_paths.append(order.get_last_contract().real_path)
    if order.get_last_schedule():
        file_paths.append(order.get_last_schedule().real_path)
    douban_contracts = User.douban_contracts()
    to_users = [k.email for k in User.douban_contracts()] + \
        _get_active_user_email(User.contracts()) + \
        _get_active_user_email(order.direct_sales + order.agent_sales + [order.creator])
    send_attach_mail(u'【合同流程】%s-%s' % (order.name, apply_context['action_msg']),
                     recipients=to_users,
                     body=order.douban_contract_email_info(
                         title=u"请帮忙打印合同, 谢谢~"),
                     file_paths=file_paths)
开发者ID:giveme168,项目名称:braavos,代码行数:19,代码来源:email_signals.py

示例3: back_money_apply

# 需要导入模块: from models.user import User [as 别名]
# 或者: from models.user.User import contracts [as 别名]
def back_money_apply(sender, apply_context):
    order = apply_context['order']
    num = apply_context['num']
    type = apply_context['type']
    if type == 'invoice':
        s_title = u'返点发票信息'
    elif type == 'end':
        s_title = u'回款完成'
    elif type == 'no_end':
        s_title = u'回款状态变为未完成'
    else:
        s_title = u'回款信息'
    if order.__tablename__ in ['searchAd_bra_client_order', 'searchAd_bra_rebate_order']:
        to_users = order.direct_sales + order.agent_sales +\
            [order.creator, g.user] + order.leaders
        title = u'【搜索部门-项目回款】%s-%s' % (order.name, s_title)
    else:
        to_users = order.direct_sales + order.agent_sales + User.contracts() +\
            [order.creator, g.user] + order.leaders + User.medias()
        if 3 in order.locations:
            to_users += [k for k in User.all() if k.email.find('chenjingjing') >= 0]
        title = u'【项目回款】%s-%s' % (order.name, s_title)
    to_emails = list(set([x.email for x in to_users]))
    flash(u'已发送邮件给 %s ' %
          (', '.join([k.name for k in list(set(to_users))])), 'info')
    
    url = mail.app.config['DOMAIN'] + order.info_path()
    
    body = u"""
订单: %s
链接地址: %s
订单合同号: %s 

回款详情:
   本次回款金额: %s
   已回款完成比例: %s %%

订单信息:
%s

\n
by %s
""" % (order.name, url, order.contract, str(num), order.back_money_percent, order.email_info, g.user.name)
    send_simple_mail(title, to_emails, body=body)
开发者ID:giveme168,项目名称:braavos,代码行数:46,代码来源:signals.py

示例4: medium_back_money_apply

# 需要导入模块: from models.user import User [as 别名]
# 或者: from models.user.User import contracts [as 别名]
def medium_back_money_apply(sender, apply_context):
    order = apply_context['order']
    num = apply_context['num']
    title = u"【新媒体订单-合同流程】- %s" % (order.name)
    s_title = u'项目回款信息-媒体返点回款信息'
    url = mail.app.config['DOMAIN'] + order.info_path()
    to_users = User.contracts() + [g.user] + User.medias()
    body = u"""
<h3 style="color:red;">流程状态: %s
回款详情:
本次回款金额: %s
订单链接地址: %s</h3>
<p><h4>订单信息:</h4>
%s</p>
<p>by %s</p>
""" % (s_title, str(num), url, order.email_info, g.user.name)
    flash(u'已发送邮件给%s' % (','.join(_get_active_user_name(to_users))), 'info')
    _insert_person_notcie(to_users, title, body)
    send_html_mail(title, recipients=_get_active_user_email(
        to_users), body=body.replace('\n', '<br/>'))
开发者ID:giveme168,项目名称:braavos,代码行数:22,代码来源:email_signals.py

示例5: contract_email

# 需要导入模块: from models.user import User [as 别名]
# 或者: from models.user.User import contracts [as 别名]
def contract_email(order, attachment):
    if order.__tablename__ == 'bra_searchAd_framework_order':
        to_users = set(User.contracts() +
                       User.medias() +
                       order.sales +
                       [order.creator, g.user])
    elif order.__tablename__ == 'searchAd_bra_client_order':
        to_users = set(User.contracts() +
                       User.medias() +
                       order.agent_sales +
                       order.direct_sales +
                       [order.creator, g.user])
    elif order.__tablename__ == 'bra_framework_order':
        to_users = set(User.contracts() +
                       order.agent_sales +
                       order.direct_sales +
                       [order.creator, g.user])
    elif order.__tablename__ == 'bra_medium_framework_order':
        to_users = set(User.contracts() +
                       order.medium_users +
                       [order.creator, g.user])
    elif order.__tablename__ == 'bra_client_medium_order':
        to_users = set(User.contracts() +
                       User.medias() +
                       order.agent_sales +
                       order.direct_sales +
                       [order.creator, g.user])
    else:
        to_users = set(User.contracts() +
                       User.medias() +
                       order.direct_sales +
                       order.agent_sales +
                       order.operaters +
                       [order.creator, g.user])

    action_msg = u"%s文件更新" % (attachment.type_cn)
    msg = u"""
    文件名:%s
    状态:%s
    上传者:%s""" % (attachment.filename, attachment.status_cn, g.user.name)
    context = {'order': order,
               'sender': g.user,
               'action_msg': action_msg,
               'info': msg,
               'to_users': to_users}
    zhiqu_contract_apply_signal.send(app._get_current_object(), context=context)
开发者ID:giveme168,项目名称:braavos,代码行数:48,代码来源:files.py


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