hi,

I am using the latest revision 12398. I am trying model validation - but the 
simplest validation possible is giving me an error - if the data is valid, no 
error, but on invalid data I get the traceback appended below. Am I doing 
something wrong or is it bug no http://code.djangoproject.com/ticket/12698? 
The validation is:

def clean(self):
        # valfrom should be less than valto
        if self.valfrom >= self.valto:
            raise ValidationError(_("Valid from should be earlier than valid 
to"))

and the traceback is:

Environment:

Request Method: POST
Request URL: http://127.0.0.1:8000/addhandicap/
Django Version: 1.2 beta 1 SVN-12398
Python Version: 2.6.0
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.admin',
 'djangogolf.web']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware')


Traceback:
File "/usr/lib/python2.6/django/core/handlers/base.py" in get_response
  101.                     response = callback(request, *callback_args, 
**callback_kwargs)
File "/usr/lib/python2.6/django/utils/decorators.py" in __call__
  36.         return self.decorator(self.func)(*args, **kwargs)
File "/usr/lib/python2.6/django/contrib/auth/decorators.py" in _wrapped_view
  24.                 return view_func(request, *args, **kwargs)
File "/usr/lib/python2.6/django/forms/forms.py" in is_valid
  120.         return self.is_bound and not bool(self.errors)
File "/usr/lib/python2.6/django/forms/forms.py" in _get_errors
  111.             self.full_clean()
File "/usr/lib/python2.6/django/forms/forms.py" in full_clean
  267.         self._clean_form()
File "/usr/lib/python2.6/django/forms/models.py" in _clean_form
  320.             self._update_errors(e.message_dict)

Exception Type: AttributeError at /addhandicap/
Exception Value: 'ValidationError' object has no attribute 'message_dict'


-- 
regards
Kenneth Gonsalves
Senior Project Officer
NRC-FOSS
http://nrcfosshelpline.in/web/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to