Django

Code

Changeset 7478

Show
Ignore:
Timestamp:
04/27/08 06:44:11 (3 weeks ago)
Author:
mtredinnick
Message:

When retrieving a field by name, handle a missed case when the cache cannot be
initialised yet.

Files:

Legend:

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

    r7477 r7478  
    249249            except AttributeError: 
    250250                cache = self.init_name_map() 
    251                 return self._name_map[name] 
     251                return cache[name] 
    252252        except KeyError: 
    253253            raise FieldDoesNotExist('%s has no field named %r'