Django

Code

Changeset 4121

Show
Ignore:
Timestamp:
11/26/06 23:02:21 (2 years ago)
Author:
adrian
Message:

newforms: Small short-circuit optimization to BoundField?.as_widget()

Files:

Legend:

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

    r4120 r4121  
    177177        attrs = attrs or {} 
    178178        auto_id = self.auto_id 
    179         if not attrs.has_key('id') and not widget.attrs.has_key('id') and auto_id
     179        if auto_id and not attrs.has_key('id') and not widget.attrs.has_key('id')
    180180            attrs['id'] = auto_id 
    181181        return widget.render(self._name, self._form.data.get(self._name, None), attrs=attrs)