Opened 10 years ago

Closed 10 years ago

#12676 closed (worksforme)

fix documetation after merge of model-validation to trunk

Reported by: Alex Koval Owned by: nobody
Component: Uncategorized Version: 1.2-alpha
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


In documentation here:

its said that valid error message keys are: required, max_length, min_length

While in fact, in trunk code those variables are:

  • limit_value
  • show_value


Documentation and code mismatch.

Change History (1)

comment:1 Changed 10 years ago by Karen Tracey

Resolution: worksforme
Status: newclosed

Near as I can tell the doc is still correct:

kmt@lbox:~/software/web/playground$ python shell
iPython 2.5.2 (r252:60911, Oct  5 2008, 19:24:49)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
>>> django.get_version()
u'1.2 alpha 1 SVN-12288'
>>> from django import forms
>>> class CForm(forms.Form):
...     s = forms.CharField(required=True,min_length=2,max_length=4,error_messages={'required': 'Gimme something', 'min
_length': 'Too Short!', 'max_length': 'Too Long'})
>>> cf = CForm({})
>>> cf.errors
{'s': [u'Gimme something']}
>>> cf = CForm({'s': '1'})
>>> cf.errors
{'s': [u'Too Short!']}
>>> cf = CForm({'s': '12345'})
>>> cf.errors
{'s': [u'Too Long']}
Note: See TracTickets for help on using tickets.
Back to Top