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


Python C3sMember.get_members方法代码示例

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


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

示例1: membership_listing_backend

# 需要导入模块: from c3smembership.models import C3sMember [as 别名]
# 或者: from c3smembership.models.C3sMember import get_members [as 别名]
def membership_listing_backend(request):
    """
    This view lets accountants view all members.

    the list is HTML with clickable links,
    not good for printout.
    """
    memberships = C3sMember.get_members(
        request.pagination.sorting.sort_property,
        how_many=request.pagination.paging.page_size,
        offset=request.pagination.paging.content_offset,
        order=request.pagination.sorting.sort_direction)
    return {
        'members': memberships,
    }
开发者ID:,项目名称:,代码行数:17,代码来源:

示例2: export_memberships

# 需要导入模块: from c3smembership.models import C3sMember [as 别名]
# 或者: from c3smembership.models.C3sMember import get_members [as 别名]
def export_memberships(request):  # pragma: no cover
    """
    Export the database to a CSV file.

    XXX TODO: implement a test-case
    """
    _num = C3sMember.get_number()
    datasets = C3sMember.get_members(
        'id', how_many=_num, offset=0, order=u'asc')
    header = [
        'firstname',
        'lastname',
        'email',
        'address1',
        'address2',
        'postcode',
        'city',
        'country',
        'locale',
        'date_of_birth',
        # 'email_is_confirmed',
        'email_confirm_code',
        'membership_date',
        'num_shares',
        # 'date_of_submission',
        # 'shares list (number+date)',
        'membership_type',
        'member_of_colsoc',
        'name_of_colsoc',
        'signature_received',
        'signature_received_date',
        'payment_received',
        'payment_received_date',
        # 'signature_confirmed',
        'signature_confirmed_date',
        # 'payment_confirmed',
        'payment_confirmed_date',
        'accountant_comment',
        'is_legalentity',
        'court of law',
        'registration number',]
    rows = []  # start with empty list
    for member in datasets:
        rows.append((
            member.firstname,
            member.lastname,
            member.email,
            member.address1,
            member.address2,
            member.postcode,
            member.city,
            member.country,
            member.locale,
            member.date_of_birth,
            # member.email_is_confirmed,
            member.email_confirm_code,
            member.membership_date,
            member.num_shares,
            # member.date_of_submission,
            # '+'.join(str(s.id)+'('+str(s.number)+')' for s in member.shares),
            member.membership_type,
            member.member_of_colsoc,
            member.name_of_colsoc,
            member.signature_received,
            member.signature_received_date,
            member.payment_received,
            member.payment_received_date,
            # member.signature_confirmed,
            member.signature_confirmed_date,
            # member.payment_confirmed,
            member.payment_confirmed_date,
            member.accountant_comment,
            member.is_legalentity,
            member.court_of_law,
            member.registration_number,))
    return {
        'header': header,
        'rows': rows}
开发者ID:,项目名称:,代码行数:80,代码来源:


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