Opened 10 years ago

Closed 10 years ago

#7144 closed (invalid)

FileField joins MEDIA_ROOT with FileDict

Reported by: cpinto Owned by: nobody
Component: Uncategorized Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


The _get_FIELD_filename function in Model class joins MEDIA_ROOT with the FIELD's value, which is, apparently a FileDict. If I get the filename value out of the dict, the function appears to work properly. Below is a sample error:

  File "/home/cpinto/programs/python/django/db/models/", line 436, in _get_FIELD_filename
    return os.path.join(settings.MEDIA_ROOT, getattr(self, field.attname))
  File "/usr/lib/python2.5/", line 60, in join
    if b.startswith('/'):
AttributeError: 'FileDict' object has no attribute 'startswith'

The proposed patch should fix this.

Attachments (1)

filefield_get_field_filename.patch (643 bytes) - added by cpinto 10 years ago.

Download all attachments as: .zip

Change History (2)

Changed 10 years ago by cpinto

comment:1 Changed 10 years ago by cpinto

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top