本文整理汇总了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,
}
示例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}