Django

Code

Changeset 6699

Show
Ignore:
Timestamp:
11/18/07 22:07:03 (1 year ago)
Author:
gwilson
Message:

Made use of EMPTY_VALUES in ModelChoiceField.clean().

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/newforms/models.py

    r6694 r6699  
    1010from util import ValidationError 
    1111from forms import BaseForm 
    12 from fields import Field, ChoiceField 
     12from fields import Field, ChoiceField, EMPTY_VALUES 
    1313from widgets import Select, SelectMultiple, MultipleHiddenInput 
    1414 
     
    201201    def clean(self, value): 
    202202        Field.clean(self, value) 
    203         if value in ('', None)
     203        if value in EMPTY_VALUES
    204204            return None 
    205205        try: