Closed keien closed 10 years ago
So as long as the document came through the uploader, it should have a path
then?
Yes.
I'll close this unless we find out that this isn't working as expected.
Actually, this might be worth discussing. Now that we are connecting the preprocessor to the frontend, we already have all the files loaded in as Documents
. However, we also have code which allows multiple Documents
per file.
However, since we are creating a Document
for every document found in a file, we are at least doubling the amount of documents existing. Much better, I think, would be to rewrite the code to get the Document
with the given path and then set all the properties for it.
This becomes more difficult when we might have several Document
s with the same path - how do we differentiate between an uploaded Document
(in which case we should fetch an existing Document
) or a file with several Document
s?
I think it would make more sense if we had one Document
per file. That seems to have been the trend anyway.
Yes I'm not sure why the original code was dealing with multiple documents per file. Perhaps it was some design decision by Aditi; we might ask her about it
We have one Document
per file now, the file name is stored as Document.path
.
The document file name should be saved by the uploader already in the
path
attribute.