#10347 closed (fixed)
AttributeError in FileDescriptor.__get__
| Reported by: | dc | Owned by: | nobody |
|---|---|---|---|
| Component: | Uncategorized | Version: | 1.0 |
| Severity: | Keywords: | ||
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
How to reproduce:
>>> from django.db import models
>>> class MyModel(models.Model):
... class Meta:
... app_label = 'dummy'
... file_field = models.FileField()
...
>>> MyModel.file_field
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "django/db/models/fields/files.py", line 118, in __get__
raise AttributeError, "%s can only be accessed from %s instances." % (self.field.name(self.owner.__name__))
AttributeError: 'FileDescriptor' object has no attribute 'owner'
Attachments (1)
Change History (3)
by , 17 years ago
| Attachment: | file-descriptor-error.patch added |
|---|
comment:1 by , 17 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
comment:2 by , 17 years ago
Note:
See TracTickets
for help on using tickets.
(In [9902]) Fixed #10347 -- Fixed incorrect AttributeError raised when attempting to access a FileField without an instance. Thanks for the report and patch dc.