Files
@ 123eb7603cee
Branch filter:
Location: website/www/conservancy/apps/contacts/views.py - annotation
123eb7603cee
778 B
text/x-python
Use typical way of putting the category in a block.
Django is so frustrating as it's never clear about how things trickle
up and down through templates, so move the category to the top like
the others.
Django is so frustrating as it's never clear about how things trickle
up and down through templates, so move the category to the top like
the others.
66dbfac066b0 8e6ea8ad71bf 71834b60ec53 8e6ea8ad71bf 8e6ea8ad71bf 8e6ea8ad71bf 8e6ea8ad71bf 8e6ea8ad71bf 8e6ea8ad71bf 8e6ea8ad71bf 8e6ea8ad71bf 8e6ea8ad71bf 8e6ea8ad71bf f7e45da6ddc8 8e6ea8ad71bf 8e6ea8ad71bf 8e6ea8ad71bf 8e6ea8ad71bf 8e6ea8ad71bf 66dbfac066b0 8e6ea8ad71bf 8e6ea8ad71bf 8e6ea8ad71bf 66dbfac066b0 | from django.shortcuts import render
from django import forms
from conservancy.apps.contacts.models 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():
form.save()
return render(request, 'contacts/subscribe_success.html', {'form': form.cleaned_data})
else:
form = ContactEntryForm()
return render(request, 'contacts/subscribe.html', {'form': form})
|