Changes between Initial Version and Version 1 of Ticket #26058


Ignore:
Timestamp:
Jan 8, 2016, 7:34:40 AM (9 years ago)
Author:
Korijn van Golen
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #26058 – Description

    initial v1  
    3434}}}
    3535
    36 As you can see, all I did was remove the local file system related logic. Unfortunately, my custom file fields need to inherit from this class to work with Azure storage, and when I switch to local storage in a different environment, they have to inherit from the regular FileField! This is obviously an undesirable situation, imposed by the otherwise-great tight coupling to local file system logic in the three methods of FileField.
     36As you can see, all I did was remove the local file system related logic. Unfortunately, my custom file fields need to inherit from this class to work with Azure storage, and when I switch to local storage in a different environment, they have to inherit from the regular FileField! This is obviously an undesirable situation, imposed by the tight coupling to local file system logic in the three methods of FileField.
    3737
    38 In order to truly decouple this, FielField would need to be a little bit more agnostic about the storage backend. This could be done by moving the generate_filename method to the backend entirely, for example.
     38In order to truly decouple this, FileField would need to be a little bit more agnostic about the storage backend. This could be done by moving the generate_filename method to the backend entirely, for example.
    3939
    40 I classified this as a bug, as this case shows that you're not "entirely" able to do anything you want when implementing custom storage backends.
     40I classified this as a bug, as this case shows that you're not ''entirely'' able to do anything you want when implementing custom storage backends.
    4141
    42 You can see the full implementation of both the backend and the numpyfilefield here: https://gist.github.com/Korijn/e0bcbdcedb494509973a
     42You can see the implementation of both the custom storage backend and the NumpyFileField here: https://gist.github.com/Korijn/e0bcbdcedb494509973a
    4343
    4444Your thoughts?
Back to Top