speakers/views.py
def show_speakers_admin(request, status=None):
    """Display a list of users who are in the speakers group"""

    users = User.objects.all()
    spkr_list = list()

    if status:
        status = Status.objects.get(name=status)
        for user in users:
            abstracts = Presentation.objects.filter(presenter=user.get_profile()).filter(status=status)
            if abstracts:
                spkr_list.append(user)
    else:
        status = "All"
        for user in users:
            spkr_list.append(user)

    if request.method == 'POST':
        for speaker in spkr_list:
            if settings.SEND_EMAIL:
                # send email here
                speaker.email_user(request.POST['subject'],
                    request.POST['email'], settings.DEFAULT_FROM_EMAIL)
            else:
                print "To: " + speaker.first_name + "\nFrom: " + settings.DEFAULT_FROM_EMAIL + "\nSubject: " + request.POST['subject'] + "\nEmail: " + request.POST['email'] + "\n\nCheers,\n\nClint Savage\n\nhttp://utosc.com \| http://utos.org"


    return render_to_response(
            'admin/speakers/show_speakers.html',
            {'object_list': spkr_list, 'description': "Speaker Name", 'status': status },
            context_instance=RequestContext(request))
Display a list of users who are in the speakers group
Display a list of users who are in the speakers group
Display a list of users who are in the speakers group
def show_speakers_admin(request, status=None):
    users = User.objects.all()
    spkr_list = list()
    if status:
        status = Status.objects.get(name=status)
        for user in users:
            abstracts = Presentation.objects.filter(presenter=user.get_profile()).filter(status=status)
            if abstracts:
                spkr_list.append(user)
    else:
        status = "All"
        for user in users:
            spkr_list.append(user)
    if request.method == 'POST':
        for speaker in spkr_list:
            if settings.SEND_EMAIL:
                speaker.email_user(request.POST['subject'],
                    request.POST['email'], settings.DEFAULT_FROM_EMAIL)
            else:
                print "To: " + speaker.first_name + "\nFrom: " + settings.DEFAULT_FROM_EMAIL + "\nSubject: " + request.POST['subject'] + "\nEmail: " + request.POST['email'] + "\n\nCheers,\n\nClint Savage\n\nhttp://utosc.com \| http://utos.org"
    return render_to_response(
            'admin/speakers/show_speakers.html',
            {'object_list': spkr_list, 'description': "Speaker Name", 'status': status },
            context_instance=RequestContext(request))
def show_speakers_admin ( request , status = None ) : users = User . objects . all ( ) spkr_list = list ( ) if status : status = Status . objects . get ( name = status ) for user in users : abstracts = Presentation . objects . filter ( presenter = user . get_profile ( ) ) . filter ( status = status ) if abstracts : spkr_list . append ( user ) else : status = "All" for user in users : spkr_list . append ( user ) if request . method == 'POST' : for speaker in spkr_list : if settings . SEND_EMAIL : speaker . email_user ( request . POST [ 'subject' ] , request . POST [ 'email' ] , settings . DEFAULT_FROM_EMAIL ) else : print "To: " + speaker . first_name + "\nFrom: " + settings . DEFAULT_FROM_EMAIL + "\nSubject: " + request . POST [ 'subject' ] + "\nEmail: " + request . POST [ 'email' ] + "\n\nCheers,\n\nClint Savage\n\nhttp://utosc.com \| http://utos.org" return render_to_response ( 'admin/speakers/show_speakers.html' , { 'object_list' : spkr_list , 'description' : "Speaker Name" , 'status' : status } , context_instance = RequestContext ( request ) )
Display a list of users who are in the speakers group
Display a list of users who are in the speakers group
"""Display a list of users who are in the speakers group""" # send email here
request
status