Discussion:
[Mayan EDMS: 2105] retaining file modification date of an uploaded file
Ben
2017-09-13 16:17:11 UTC
Permalink
Hi,

Is there any way to access or save the modification date of an uploaded
file? I need to upload thousands of old documents and I am using a watch
folder for it. The upload works fine but the document timestamp is the time
when the document was added to Mayan.
It would be nice to have the modification date of the file to filter
searches.
I cannot find anything in Django: The UploadedFile class has only a few
attributes ( name, size, ... ) but no modification date.

Ben
--
---
You received this message because you are subscribed to the Google Groups "Mayan EDMS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mayan-edms+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Roberto Rosario
2017-09-13 16:44:24 UTC
Permalink
Hi,

Yes, I think creation and last modification date are only readable via
filesystem calls in Python. I'll take a look at all the internal to see if
this is true. If the dates are somehow available they can be added as two
extra fields in the document version model with no compatibility issues.

On Sep 13, 2017 12:17 PM, "Ben" <***@useit-mw.com> wrote:

Hi,

Is there any way to access or save the modification date of an uploaded
file? I need to upload thousands of old documents and I am using a watch
folder for it. The upload works fine but the document timestamp is the time
when the document was added to Mayan.
It would be nice to have the modification date of the file to filter
searches.
I cannot find anything in Django: The UploadedFile class has only a few
attributes ( name, size, ... ) but no modification date.

Ben
--
---
You received this message because you are subscribed to the Google Groups
"Mayan EDMS" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to mayan-edms+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
---
You received this message because you are subscribed to the Google Groups "Mayan EDMS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mayan-edms+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Ben
2017-09-13 18:38:32 UTC
Permalink
Thanks Roberto for this info.
I will try to add the timestamp (from getmtime) to the filename, put them
in the watch folder, split the filenames after an upload to get the
timestamp and add an extra field in the document version model. Maybe not
the most elegant way but it is only for the initial bulk upload, for new
documents the users have to add it manually through metadata.

Ben
Post by Roberto Rosario
Hi,
Yes, I think creation and last modification date are only readable via
filesystem calls in Python. I'll take a look at all the internal to see if
this is true. If the dates are somehow available they can be added as two
extra fields in the document version model with no compatibility issues.
Hi,
Is there any way to access or save the modification date of an uploaded
file? I need to upload thousands of old documents and I am using a watch
folder for it. The upload works fine but the document timestamp is the time
when the document was added to Mayan.
It would be nice to have the modification date of the file to filter
searches.
I cannot find anything in Django: The UploadedFile class has only a few
attributes ( name, size, ... ) but no modification date.
Ben
--
---
You received this message because you are subscribed to the Google Groups
"Mayan EDMS" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
---
You received this message because you are subscribed to the Google Groups "Mayan EDMS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mayan-edms+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...