Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#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)

file-descriptor-error.patch (777 bytes ) - added by dc 16 years ago.

Download all attachments as: .zip

Change History (3)

by dc, 16 years ago

Attachment: file-descriptor-error.patch added

comment:1 by Karen Tracey, 16 years ago

Resolution: fixed
Status: newclosed

(In [9902]) Fixed #10347 -- Fixed incorrect AttributeError raised when attempting to access a FileField without an instance. Thanks for the report and patch dc.

comment:2 by Karen Tracey, 16 years ago

(In [9903]) [1.0.X] Fixed #10347 -- Fixed incorrect AttributeError raised when attempting to access a FileField without an instance. Thanks for the report and patch dc.

[9902] from trunk. Also updated svnmerge metadata; all trunk changesets have either been merged or blocked.

Note: See TracTickets for help on using tickets.
Back to Top