Changes between Initial Version and Version 1 of Ticket #26058
- Timestamp:
- Jan 8, 2016, 7:34:40 AM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #26058 – Description
initial v1 34 34 }}} 35 35 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-greattight coupling to local file system logic in the three methods of FileField.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 tight coupling to local file system logic in the three methods of FileField. 37 37 38 In order to truly decouple this, Fi elField 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.38 In 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. 39 39 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.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. 41 41 42 You can see the full implementation of both the backend and the numpyfilefield here: https://gist.github.com/Korijn/e0bcbdcedb494509973a42 You can see the implementation of both the custom storage backend and the NumpyFileField here: https://gist.github.com/Korijn/e0bcbdcedb494509973a 43 43 44 44 Your thoughts?