Пример #1
0
def members(request, group=None):
    if not group:
        first_plan = MembershipPlan.objects.all().order_by('name').first()
        if first_plan:
            group = first_plan.name

    members = MemberGroups.get_members(group)
    if members:
        member_count = members.count()
        group_name = MemberGroups.GROUP_DICT[group]
    else:
        # Assume the group is a membership plan
        members = Member.objects.members_by_plan(group)
        member_count = len(members)
        group_name = "%s Members" % group

    # How many members do we have?
    total_members = Member.objects.active_members().count()
    group_list = MemberGroups.get_member_groups()

    return render_to_response('staff/members.html', {
        'group': group,
        'group_name': group_name,
        'members': members,
        'member_count': member_count,
        'group_list': group_list,
        'total_members': total_members
    },
                              context_instance=RequestContext(request))
Пример #2
0
def member_bcc(request, group=None):
    if not group:
        group = MemberGroups.ALL
        group_name = "All Members"
        users = User.helper.active_members()
    elif group in MemberGroups.GROUP_DICT:
        group_name = MemberGroups.GROUP_DICT[group]
        users = MemberGroups.get_members(group)
    else:
        group_name = "%s Members" % group
        users = User.helper.members_by_plan(group)
    group_list = MemberGroups.get_member_groups()
    return render_to_response('staff/member_bcc.html', {'group': group, 'group_name': group_name, 'group_list': group_list, 'users': users}, context_instance=RequestContext(request))
Пример #3
0
def member_bcc(request, group=None):
    if not group:
        group = MemberGroups.ALL
        group_name = "All Members"
        members = Member.objects.active_members()
    elif group in MemberGroups.GROUP_DICT:
        group_name = MemberGroups.GROUP_DICT[group]
        members = MemberGroups.get_members(group)
    else:
        group_name = "%s Members" % group
        members = Member.objects.members_by_plan(group)
    group_list = MemberGroups.get_member_groups()
    print group
    return render_to_response('staff/member_bcc.html', {'group': group, 'group_name': group_name, 'group_list': group_list, 'members': members}, context_instance=RequestContext(request))
Пример #4
0
def members(request, group=None):
    if not group:
        first_plan = MembershipPlan.objects.all().order_by('name').first()
        if first_plan:
            group = first_plan.name

    users = MemberGroups.get_members(group)
    if users:
        member_count = users.count()
        group_name = MemberGroups.GROUP_DICT[group]
    else:
        # Assume the group is a membership plan
        users = User.helper.members_by_plan(group)
        member_count = len(users)
        group_name = "%s Members" % group

    # How many members do we have?
    total_members = User.helper.active_members().count()
    group_list = MemberGroups.get_member_groups()

    context = {'group': group, 'group_name': group_name, 'users': users,
        'member_count': member_count, 'group_list': group_list, 'total_members': total_members}
    return render(request, 'staff/members.html', context)
Пример #5
0
def members(request, group=None):
    if not group:
        first_plan = MembershipPlan.objects.all().order_by('name').first()
        if first_plan:
            group = first_plan.name

    members = MemberGroups.get_members(group)
    if members:
        member_count = members.count()
        group_name = MemberGroups.GROUP_DICT[group]
    else:
        # Assume the group is a membership plan
        members = Member.objects.members_by_plan(group)
        member_count = len(members)
        group_name = "%s Members" % group

    # How many members do we have?
    total_members = Member.objects.active_members().count()
    group_list = MemberGroups.get_member_groups()

    return render_to_response('staff/members.html', {'group': group, 'group_name': group_name, 'members': members,
                                                     'member_count': member_count, 'group_list': group_list, 'total_members': total_members
                                                     }, context_instance=RequestContext(request)
                              )