Django

Code

Ticket #1858 (closed: fixed)

Opened 3 years ago

Last modified 2 years ago

[patch] typo in get_FOO_size

Reported by: tom@jerakeen.org Assigned to: adrian
Milestone: Component: Core framework
Version: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

the magic accessor to get the size of an uploaded file is broken. Trivial patch.

Attachments

get_file_size.diff (0.5 kB) - added by tom@jerakeen.org on 05/14/06 14:25:29.

Change History

05/14/06 14:25:29 changed by tom@jerakeen.org

  • attachment get_file_size.diff added.

05/14/06 14:42:42 changed by tom@jerakeen.org

Sorry, I did't really demonstrate the problem. The magic 'get_FOO_size' accessor is broken. A call to 'get_file_size' in a test model throws

  File "/usr/lib/python2.4/site-packages/Django-0.91-py2.4.egg/django/utils/functional.py", line 3, in _curried
    return args[0](*(args[1:]+moreargs), **dict(kwargs.items() + morekwargs.items()))
  File "/usr/lib/python2.4/site-packages/Django-0.91-py2.4.egg/django/db/models/base.py", line 301, in _get_FIELD_size
    return os.path.getsize(self.__get_FIELD_filename(field))
AttributeError: 'Upload' object has no attribute '_Model__get_FIELD_filename'

I'd like to test this case, but I presume this will require a writable MEDIA_ROOT for the test suite, which seems like a large requirement to me.

05/14/06 19:15:23 changed by mtredinnick

  • status changed from new to closed.
  • resolution set to fixed.

(In [2903]) Fixed #1858 : typo in get_FIELD_size() method. Thanks, tom@jerakeen.org.


Add/Change #1858 ([patch] typo in get_FOO_size)




Change Properties
Action