Files @ f6bbcc7ee328
Branch filter:

Location: website/www/conservancy/apps/contacts/

Just quit it with this relative import stuff.

While I think these relative imports seem to be valid for the running
application, I am having trouble with the django-admin applications
regarding them. I don't see this syntactic sugar as absolutely
essential, so I'm just going to change it now.
from django.shortcuts import render_to_response
from django import forms
from import ContactEntry
from django.forms import ModelForm

def subscribe(request):
    """Mailing list subscription form

    class ContactEntryForm(ModelForm):
        class Meta:
            model = ContactEntry

    ContactEntryForm.base_fields['subscribe_conservancy'].label = 'Receive Software Freedom Conservancy updates'

    if request.method == 'POST':
        form = ContactEntryForm(request.POST)
        if form.is_valid():
            return render_to_response('contacts/subscribe_success.html',
                                      {'form': form.cleaned_data})
        form = ContactEntryForm()

    return render_to_response('contacts/subscribe.html',
                              {'form': form})