Example #1
0
def filterAll(request, download=None):
  upcoming = getNextMeeting()
  f = MeetingFilterSet(request.GET or None)
  numMeetings = f.qs.count()
  csvDownloadLink = getDownloadLink(request,'csv')

  if download == 'csv':
    # generate CSV for download
    response = HttpResponse(mimetype='text/csv')
    response['Content-Disposition'] = 'attachment; filename=meeting_query_%s.csv' % datetime.datetime.now().strftime('%m%d%Y_%H%M')
    writer = csv.writer(response)
    writer.writerow(['Date','Title','Dinner (T/F)','Details','Topics','Presenters'])
    for m in f.qs:
      meetingTopics = m.topics.all()
      topics, presenters  = ([],[])
      if meetingTopics:
        for topic in meetingTopics:
          topics.append(topic.topic)
          presenters.append(topic.presenter)
      if topics:
        topics = '\n'.join(topics)
        presenters = '\n'.join(presenters)
      else:
        topics, presenters = ('', '')
      writer.writerow([str(m.date),str(m.title),str(m.is_dinner),str(m.details).replace(',',''),topics,presenters])
    return response
  return render_to_response('meetings/search.html', {'filter': f, 'numMeetings': numMeetings, 'upcoming': upcoming, 'csvDownloadLink': csvDownloadLink}, context_instance=RequestContext(request))
Example #2
0
def irc(request):
    upcoming = getNextMeeting()
    return render_to_response('irc.html', {
        'upcoming': upcoming,
        'guest_name': 'guest_' + str(random(0, 99))
    },
                              context_instance=RequestContext(request))
Example #3
0
def index(request):
    meetings = getCurrentSemesterMeetings()
    upcoming = getNextMeeting()
    return render_to_response('meetings/index.html', {
        'meetings': meetings,
        'upcoming': upcoming
    },
                              context_instance=RequestContext(request))
Example #4
0
def contact(request={}):
  ''' Contact'''
  if request.POST:
    form = ContactForm(request.POST)
    if form.is_valid():
      cs = form.save() # sends emails
      return render_to_response('contact/thankyou.html', {'submission': cs, 'upcoming': getNextMeeting()}, context_instance=RequestContext(request))
  else:
    form = ContactForm()
  return render_to_response('contact/form.html', {'form': form, 'upcoming': getNextMeeting()}, context_instance=RequestContext(request))
def index(request):
    officers = UserProfile.objects.all().filter(
        is_officer=True,
        user__is_active=True).order_by('officer_position_rank_order',
                                       'officer_position', 'user__first_name')
    OFFICERS = [(o.user, o) for o in officers]
    return render_to_response('officers.html', {
        'officers': OFFICERS,
        'upcoming': getNextMeeting()
    },
                              context_instance=RequestContext(request))
Example #6
0
def filterAll(request, download=None):
    upcoming = getNextMeeting()
    f = MeetingFilterSet(request.GET or None)
    numMeetings = f.qs.count()
    csvDownloadLink = getDownloadLink(request, 'csv')

    if download == 'csv':
        # generate CSV for download
        response = HttpResponse(mimetype='text/csv')
        response[
            'Content-Disposition'] = 'attachment; filename=meeting_query_%s.csv' % datetime.datetime.now(
            ).strftime('%m%d%Y_%H%M')
        writer = csv.writer(response)
        writer.writerow([
            'Date', 'Title', 'Dinner (T/F)', 'Details', 'Topics', 'Presenters'
        ])
        for m in f.qs:
            meetingTopics = m.topics.all()
            topics, presenters = ([], [])
            if meetingTopics:
                for topic in meetingTopics:
                    topics.append(topic.topic)
                    presenters.append(topic.presenter)
            if topics:
                topics = '\n'.join(topics)
                presenters = '\n'.join(presenters)
            else:
                topics, presenters = ('', '')
            writer.writerow([
                str(m.date),
                str(m.title),
                str(m.is_dinner),
                str(m.details).replace(',', ''), topics, presenters
            ])
        return response
    return render_to_response('meetings/search.html', {
        'filter': f,
        'numMeetings': numMeetings,
        'upcoming': upcoming,
        'csvDownloadLink': csvDownloadLink
    },
                              context_instance=RequestContext(request))
Example #7
0
def index(request):
  meetings = getCurrentSemesterMeetings()
  upcoming = getNextMeeting()
  return render_to_response('meetings/index.html',
         {'meetings': meetings, 'upcoming': upcoming},
         context_instance=RequestContext(request))
Example #8
0
def index(request):
    upcoming = getNextMeeting()
    return render_to_response('index.html', {'upcoming': upcoming},
                              context_instance=RequestContext(request))
def index(request):
  officers = UserProfile.objects.all().filter(is_officer=True, user__is_active=True).order_by('officer_position_rank_order','officer_position','user__first_name')
  OFFICERS = [(o.user, o) for o in officers]
  return render_to_response('officers.html', {'officers': OFFICERS, 'upcoming': getNextMeeting()}, context_instance=RequestContext(request))
Example #10
0
def index(request):
  upcoming = getNextMeeting()
  return render_to_response('index.html', {'upcoming': upcoming}, context_instance=RequestContext(request))
Example #11
0
def irc(request):
  upcoming= getNextMeeting()
  return render_to_response('irc.html', {'upcoming': upcoming, 'guest_name':'guest_'+str(random(0,99))}, context_instance=RequestContext(request))