On Monday, October 8, 2012 8:49:58 AM UTC-7, Dan Loewenherz wrote:
>
>
> > On Mon, Oct 1, 2012 at 12:47 AM, Jannis Leidel 
> > <[email protected]<javascript:>> 
>> wrote:
>> Then, frankly, this is a problem of the storage backends, not Django's. 
>> The S3BotoStorage backend *does* have a modified_time method:
>>
>>   
>> https://bitbucket.org/david/django-storages/src/1574890d87be/storages/backends/s3boto.py#cl-298
>>
>> What storage backend do you use that doesn't have a modified_time method?
>>
>
> I don't think you're seeing the problem I'm having. I'm working with a 
> distributed team using git. This means when we check out files, the local 
> modified time is the time at which I checked the files out, not the time 
> which the files were actually last modified.
>
> As a result, it's a questionable metric for figuring out if a file is the 
> same or not, since every team member's local machine thinks they were all 
> just created! We end up re-uploading the file every time.
>

While git may be common, and your problem not unique - this is still a 
condition of your dev environment rendering modification dates invalid. 
There might be other situations where this is the case (I've run into 
scripts that muck with modification dates based on camera/jpeg metadata).

So after some further discussion on IRC - it was determined that md5, while 
somewhat common, was far from a standard, and was likely not to be 
available as remote call for network based storage backends. And so the 
final resolution is to wontfix the ticket.

In the end - this lack of a universal fingerprint is just a limitation of 
our storage tools.

-Preston


> > This is a bit confusing...why call it last_modified when that's doesn't 
>> necessarily reflect what it's doing? It would be more flexible to create 
>> two methods:
>>
>> It's called modified_time, not last_modified.
>>
>
> Sorry, typo.
>  
>
>>
>> > def modification_identifier(self):
>> >
>> > def has_changed(self):
>> >
>> > Then, any backend could implement these however they might like, and 
>> collectstatic would have no excuse in uploading the same file more than 
>> once. Overloading last_modified to also do things like calculate md5's 
>> seems a bit hacky to me, and confusing for any developer maintaining a 
>> custom storage backend that doesn't support last modified.
>>
>> I disagree, modified_time is perfectly capable of handling your use case.
>>
>
> No it does not address my needs, as I described above.
>
> Dan
>

-- 
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/-/pCGNll2gjiYJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to