Opened 16 years ago

Closed 16 years ago

#7144 closed (invalid)

FileField joins MEDIA_ROOT with FileDict

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

Description

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/base.py", line 436, in _get_FIELD_filename
    return os.path.join(settings.MEDIA_ROOT, getattr(self, field.attname))
  File "/usr/lib/python2.5/posixpath.py", 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 16 years ago.

Download all attachments as: .zip

Change History (2)

comment:1 by cpinto, 16 years ago

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