aaugustin / django-resto

REplicated STOrage for Django, file backends that mirror media files to several servers over HTTP [UNMAINTAINED]
https://django-resto.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
104 stars 8 forks source link

Define storage for one specific model #8

Closed legus closed 9 years ago

legus commented 9 years ago

Greetings.

My name is Gustavo, from colombia. first of all I wanted to say thanks because we are using django_resto for our repository and we think is an impressive and easy to use tool..

However, recently we had to include some new features to django admin interface, letting adminstrator to upload images to specific models.. This is causing the need to change the media url and the default storage in the settings..

In your Readme document, you specify "You can also enable a backend only for selected fields in your models.", but I've been trying to do it without success.

I put in my model this parameter: from django_resto.storage import DistributedStorage

models.FileField(..., storage=DistributedStorage...)

We don't know what are we missing.

Thanks in advance.

Note: error displayed when we try to upload a new instance of the model...

unbound method save() must be called with DistributedStorage instance as first argument (got unicode instance instead)

aaugustin commented 9 years ago

Did you try instantiating the storage i.e. storage=DistributedStorage()?

legus commented 9 years ago

Thanks a lot...

Yes.. that was the problem..

I'm trully sorry, I should've tried that before asking.

aaugustin commented 9 years ago

No problem, glad I could help!