Jorge Ezequiel Diaz Marquez avatar Jorge Ezequiel Diaz Marquez committed abd214c

fix issue #43

Comments (0)

Files changed (1)

apps/djcontact/forms.py

 
     name = forms.CharField(max_length=100, widget=forms.TextInput(attrs=attrs_dict), label=_(u'Nombre y Apellido'))
     email = forms.EmailField(widget=forms.TextInput(attrs=dict(attrs_dict, maxlength=200)), label=_(u'Email'))
+    phone = forms.CharField(max_length=25, widget=forms.TextInput(attrs=attrs_dict), label=_(u'Telefono'))
     body = forms.CharField(widget=forms.Textarea(attrs=attrs_dict), label=_(u'Mensaje'))
-    
+
     captcha = CaptchaField(label=_(u'Seguridad'))
 
     from_email = settings.DEFAULT_FROM_EMAIL
     recipient_list = [mail_tuple[1] for mail_tuple in settings.MANAGERS]
-    subject_template_name = "djcontact/contact_form_subject.txt"    
+    subject_template_name = "djcontact/contact_form_subject.txt"
     template_name = 'djcontact/contact_form.txt'
 
 
     def message(self):
         """
         Render the body of the message to a string.
-        
+
         """
         if callable(self.template_name):
             template_name = self.template_name()
             template_name = self.template_name
         return loader.render_to_string(template_name,
                                        self.get_context())
-    
+
     def subject(self):
         """
         Render the subject of the message to a string.
-        
+
         """
         subject = loader.render_to_string(self.subject_template_name,
                                           self.get_context())
         return ''.join(subject.splitlines())
-    
+
     def get_context(self):
         """
         Return the context used to render the templates for the email
 
         * Any additional variables added by context processors (this
           will be a ``RequestContext``).
-        
+
         """
         if not self.is_valid():
             raise ValueError("Cannot generate Context from invalid contact form")
         return RequestContext(self.request,
                               dict(self.cleaned_data,
                                    site=Site.objects.get_current()))
-    
+
     def get_message_dict(self):
         """
         Generate the various parts of the message and return them in a
         * ``recipient_list``
 
         * ``subject``
-        
+
         """
         if not self.is_valid():
             raise ValueError("Message cannot be sent from invalid contact form")
             attr = getattr(self, message_part)
             message_dict[message_part] = callable(attr) and attr() or attr
         return message_dict
-    
+
     def save(self, fail_silently=False):
         """
         Build and send the email message.
-        
+
         """
         send_mail(fail_silently=fail_silently, **self.get_message_dict())
+
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.