| | 285 | |
| | 286 | === Raw `grep` results === |
| | 287 | |
| | 288 | ==== `__class__` keyword used for accessing anything other than `__name__` === |
| | 289 | |
| | 290 | {{{ |
| | 291 | $ grep -r '__class__\.' django/ | egrep -v '(\.svn|\.html|\.css|\.pyc|_doctest\.py|__class__\.__name__)' | sort | uniq |
| | 292 | }}} |
| | 293 | |
| | 294 | yields the following results |
| | 295 | |
| | 296 | {{{ |
| | 297 | django/contrib/auth/middleware.py: request.__class__.user = LazyUser() |
| | 298 | django/contrib/contenttypes/models.py: ct = self.__class__._cache[id] |
| | 299 | django/contrib/contenttypes/models.py: ct = self.__class__._cache[key] |
| | 300 | django/contrib/contenttypes/models.py: self.__class__._cache.clear() |
| | 301 | django/contrib/contenttypes/models.py: self.__class__._cache[ct.id] = ct |
| | 302 | django/contrib/contenttypes/models.py: self.__class__._cache[key] = ct |
| | 303 | django/db/models/base.py: q = self.__class__._default_manager.filter(**kwargs).order_by((not is_next and '-' or '') + field.name, (not is_next and '-' or '') + self._meta.pk.name) |
| | 304 | django/db/models/base.py: raise self.DoesNotExist, "%s matching query does not exist." % self.__class__._meta.object_name |
| | 305 | django/db/models/fields/__init__.py: not instance.__class__._default_manager.filter(**{'%s__exact' % self.name: getattr(instance, self.attname)}): |
| | 306 | django/dispatch/saferef.py: del self.__class__._allInstances[ self.key ] |
| | 307 | django/newforms/models.py: opts = instance.__class__._meta |
| | 308 | django/newforms/models.py: opts = instance.__class__._meta |
| | 309 | }}} |