Ticket #8534: django-8534-filefield-size.patch

File django-8534-filefield-size.patch, 512 bytes (added by snaury, 16 years ago)
  • django/db/models/fields/files.py

    === modified file 'django/db/models/fields/files.py'
     
    5151        return self.storage.path(self.name)
    5252    path = property(_get_path)
    5353
     54    def _get_size(self):
     55        self._require_file()
     56        return self.storage.size(self.name)
     57    size = property(_get_size)
     58
    5459    def _get_url(self):
    5560        self._require_file()
    5661        return self.storage.url(self.name)
Back to Top