Django

Code

Changeset 6786

Show
Ignore:
Timestamp:
12/01/07 10:52:49 (1 year ago)
Author:
adrian
Message:

Edited docs/newforms.txt changes from [6625]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/docs/newforms.txt

    r6769 r6786  
    11061106**New in Django development version** 
    11071107 
    1108 The ``error_messages`` argument lets you override the default messages which the 
     1108The ``error_messages`` argument lets you override the default messages that the 
    11091109field will raise. Pass in a dictionary with keys matching the error messages you 
    1110 want to override. For example:: 
     1110want to override. For example, here is the default error message:: 
    11111111 
    11121112    >>> generic = forms.CharField() 
     
    11161116    ValidationError: [u'This field is required.'] 
    11171117 
     1118And here is a custom error message:: 
     1119 
    11181120    >>> name = forms.CharField(error_messages={'required': 'Please enter your name'}) 
    11191121    >>> name.clean('') 
     
    11221124    ValidationError: [u'Please enter your name'] 
    11231125 
    1124 In the `built-in Field classes`_ section below, each Field defines the error 
    1125 message keys it uses.   
     1126In the `built-in Field classes`_ section below, each ``Field`` defines the 
     1127error message keys it uses. 
    11261128 
    11271129Dynamic initial values