public
Description: The source code for the Django Plugables application index.
Homepage: http://djangoplugables.com/
Clone URL: git://github.com/revyver/django-plugables.git
Search Repo:
Changed around a few things on django-contact-form.
revyver (author)
Thu Apr 10 00:43:33 -0700 2008
commit  71af62449aa19ae91ef51d4c74241ac8c678b731
tree    f3a9ac7c6a36c2791a2110a7d25efba69684a266
parent  51eb96b39adbedd6d32d396ea03e402fd3a21b78
...
152
153
154
155
 
 
 
 
 
 
 
 
 
 
 
 
 
156
157
158
...
152
153
154
 
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
0
@@ -152,7 +152,19 @@ class ContactForm(forms.Form):
0
     
0
     recipient_list = [mail_tuple[1] for mail_tuple in settings.MANAGERS]
0
     
0
- subject = "[%s] Message sent through the web site" % Site.objects.get_current().name
0
+ subject_template_name = 'contact_form/contact_form_subject.txt'
0
+
0
+ def subject(self):
0
+ """
0
+ Renders the subject of the message to a string.
0
+ """
0
+ if callable(self.subject_template_name):
0
+ template_name = self.subject_template_name()
0
+ else:
0
+ template_name = self.subject_template_name
0
+ t = loader.get_template(template_name)
0
+ # subject must not contain newlines
0
+ return ' '.join(t.render(RequestContext(self.request, self.cleaned_data)).splitlines())
0
     
0
     template_name = 'contact_form/contact_form.txt'
0
     
...
14
15
16
17
 
18
19
20
...
14
15
16
 
17
18
19
20
0
@@ -14,7 +14,7 @@ hierarchy (for best results with the defaults, include it under
0
 from django.conf.urls.defaults import *
0
 from django.views.generic.simple import direct_to_template
0
 
0
-from contact_form.views import contact_form
0
+from views import contact_form
0
 
0
 
0
 urlpatterns = patterns('',
...
9
10
11
12
 
13
14
15
...
9
10
11
 
12
13
14
15
0
@@ -9,7 +9,7 @@ from django.shortcuts import render_to_response
0
 from django.template import RequestContext
0
 from django.contrib.auth.views import redirect_to_login
0
 
0
-from contact_form.forms import ContactForm
0
+from forms import ContactForm
0
 
0
 
0
 def contact_form(request, form_class=ContactForm, template_name='contact_form/contact_form.html', success_url='/contact/sent/', login_required=False, fail_silently=False):

Comments

    No one has commented yet.