Hi Stephen, On Tuesday, October 9, 2012 7:28:43 AM UTC+2, Stephen Burrows wrote: > > I'm a little confused by the track the discussion took recently... my > impression was that the solution would *not* be to change from > last_modified to a checksum, or to add an additional checksum method. > Instead, storage backeds could support a has_changed method, which could be > overridden to provide last_modified checking *or* checksum comparisons - or > any other method of checking whether a file has changed. This seems like a > useful, easy-to-explain, very generic way to handle checking whether a file > has changed.
This would be one way to do it (we've also discussed that in IRC), but we couldn't figure out any implementation that would actually be useable. To make this work you'd need to have a function signature like "def has_changed(file_name, other_thing)" whereas other_thing would be some hash/modified_time whatever provided by the source storage. Now we are back to the situation I described in my answer to Jeremy… > And since what staticfiles actually cares about is whether the file has > changed, it seems like it would make more sense to use a method that checks whether the file has changed, rather than > just checking the last modification date. Well staticfiles doesn't care, it's only collectstatic which cares to some extend. So in my opinion the cleanest way (which means without coupling the two needed storage backends together to strongly) is to provide your own collectstatic command where you can do what you want with the checks (if you have problems implementing that we'd happily move some code to extra methods to make reusing collectstatic easier). > Would I be correct in thinking that the main argument against this is API > bloat, or is there something else that I'm not seeing? > I'd rather say: We don't see __any__ nice way to actually support something which is generic enough the be useful. Cheers, Florian -- You received this message because you are subscribed to the Google Groups "Django developers" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-developers/-/vjZYGSYGnwUJ. To post to this group, send email to django-developers@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.