Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class SignUp(models.Model):
- customer_name=models.CharField(max_length=100,blank=False, primary_key=True)
- customer_website_url=models.CharField(max_length=200, blank=True)
- account_manager_email = models.EmailField(blank=False)
- customer_uuid= models.CharField(max_length = 32)
- timestamp = models.DateTimeField(auto_now_add=True, auto_now=False)
- def __unicode__(self):
- return self.customer_uuid
- class SignUpForm(models.ModelForm):
- class Meta:
- model= SignUp
- fields=['customer_name',
- 'customer_website_url',
- 'account_manager_email',
- ]
- def clean_account_manager_email(self):
- account_manager_email = self.cleaned_data.get('account_manager_email')
- if not "google" in account_manager_email:
- raise forms.ValidationError("Please use a valid email address")
- return account_manager_email
- def __init__ (self, *args, **kwargs):
- super(SignUpForm, self).__init__(self, *args, **kwargs)
- self.uuid = random_uuid = uuid.uuid4().hex
- def save(self, commit=True):
- signup = super(SignUpForm,self).save(commit = False)
- signup.customer_uuid = self.uuid
- signup.save()
- return signup
- File "/Library/Python/2.7/site-packages/Django-1.8.3-py2.7.egg/django/core/handlers/base.py" in get_response
- 132. response = wrapped_callback(request, *callback_args, **callback_kwargs)
- File "/Users/user/Documents/work/src/info/views.py" in home
- 32. if form.is_valid():
- File "/Library/Python/2.7/site-packages/Django-1.8.3-py2.7.egg/django/forms/forms.py" in is_valid
- 184. return self.is_bound and not self.errors
- File "/Library/Python/2.7/site-packages/Django-1.8.3-py2.7.egg/django/forms/forms.py" in errors
- 176. self.full_clean()
- File "/Library/Python/2.7/site-packages/Django-1.8.3-py2.7.egg/django/forms/forms.py" in full_clean
- 392. self._clean_fields()
- File "/Library/Python/2.7/site-packages/Django-1.8.3-py2.7.egg/django/forms/forms.py" in _clean_fields
- 401. value = field.widget.value_from_datadict(self.data, self.files, self.add_prefix(name))
- File "/Library/Python/2.7/site-packages/Django-1.8.3-py2.7.egg/django/forms/widgets.py" in value_from_datadict
- 223. return data.get(name, None)
- Exception Type: AttributeError at /
- Exception Value: 'SignUpForm' object has no attribute 'get'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement