def sponsorships (request): (themeName) = theme_init (request) clear_menustatus () menustatus['sponsor'] = 'selected' sorted_sponsors = Sponsor.the_sponsors () extra_form_fields = '_sponsor_extra_fields.html' sf = None message = '' if 'POST' == request.method: sf = SponsorForm (request.POST) if sf.is_valid (): theOrgQs = Organization.objects.filter (name__exact = sf.cleaned_data['name']) if 0 < theOrgQs.count (): theOrg = theOrgQs[0] else: theOrg = Organization (name = sf.cleaned_data['name'], contactname = sf.cleaned_data['contactname'], contactinfo = sf.cleaned_data['contactinfo']) if sf.cleaned_data['linkurl']: theOrg.linkurl = sf.cleaned_data['linkurl'] if sf.cleaned_data['comment']: theOrg.comment = sf.cleaned_data['comment'] if sf.cleaned_data['howhear']: theOrg.howhear = sf.cleaned_data['howhear'] theOrg.save () theSponsor = Sponsor (organization = theOrg, level = sf.cleaned_data['level'], confirmed = False) theSponsor.save () sf = SponsorForm () message = 'Thank you! We\'ll get in touch soon with %s to confirm %s\'s sponsorship.' % (theOrg.contactname, theOrg.name) else: sf = SponsorForm () theme = Theme.objects.get (name = themeName) return render_to_response ('sponsorships.html', { #'sponsors' : sponsors, 'sorted_sponsors' : sorted_sponsors, #'ugs' : ugs, 'extra_form_fields' : extra_form_fields, 'settings' : settings, 'menustatus' : menustatus, 'form' : sf, 'message' : message, 'theme' : theme, 'subtitle' : 'Sponsors', }, context_instance = RequestContext (request))
def exhibitors (request): (themeName) = theme_init (request) clear_menustatus () menustatus['exhibitor'] = 'selected' sorted_sponsors = Sponsor.the_sponsors () ugs = UserGroup.objects.filter (confirmed__exact = True) extra_form_fields = '_exhibitor_extra_fields.html' ef = None message = '' if 'POST' == request.method: ef = UserGroupForm (request.POST) if ef.is_valid (): theOrgQs = Organization.objects.filter (name__exact = ef.cleaned_data ['name']) if 0 < theOrgQs.count (): theOrg = theOrgQs[0] else: theOrg = Organization (name = ef.cleaned_data['name'], contactname = ef.cleaned_data['contactname'], contactinfo = ef.cleaned_data['contactinfo']) if ef.cleaned_data['linkurl']: theOrg.linkurl = ef.cleaned_data['linkurl'] if ef.cleaned_data['comment']: theOrg.comment = ef.cleaned_data['comment'] if ef.cleaned_data['howhear']: theOrg.howhear = ef.cleaned_data['howhear'] theOrg.save () theExh = UserGroup (organization = theOrg, mailinglist = ef.cleaned_data['mailinglist'], confirmed = False) theExh.save () ef = UserGroupForm () message = 'Thank you! We\'ll get in touch with %s to confirm %s\'s registration.' % (theOrg.contactname, theOrg.name) else: ef = UserGroupForm () theme = Theme.objects.get (name = themeName) return render_to_response ('exhibitors.html', { 'sorted_sponsors' : sorted_sponsors, 'ugs' : ugs, 'extra_form_fields' : extra_form_fields, 'settings' : settings, 'menustatus' : menustatus, 'form' : ef, 'message' : message, 'theme' : theme, 'subtitle' : 'User Groups', }, context_instance = RequestContext (request))