1. David Larlet
  2. django-storages
  3. Issues


Issue #103 new

Method to return whole tree

Anonymous created an issue

When you call //listdir// method of //S3BotoStorage//, boto gets full, recursive repository listing. After that S3BotoStorage filters it and returns filtered list. Rest is discarded.

If I need whole directory tree, I would have to call listdir countless times and //S3BotoStorage// would download whole tree (that I probably need) at every call.

How about creating method which would download that tree once and after parsing it into (nested) array of //S3BotoStorageFile//s would return it?

Having In mind, that every list request could cost a lot (especially from speed perspective) I think this is the way to go.

P.S. I could as well do {{{


s = S3BotoStorage() name = s._normalize_name(s._clean_name("")) list(s.bucket.list(s._encode_name(name))) }}} However,

It gives list of boto objects, not Django File-like ones.

If any name in function itself would change, it would break this code too.

If I extend //S3BotoStorage//, point number 2 applies.