Wordseer / wordseer

The WordSeer text analysis tool, written in Flask.
http://wordseer.berkeley.edu/
40 stars 16 forks source link

Pass in and save document file name #113

Closed keien closed 10 years ago

abendebury commented 10 years ago

The document file name should be saved by the uploader already in the path attribute.

keien commented 10 years ago

So as long as the document came through the uploader, it should have a path then?

abendebury commented 10 years ago

Yes.

abendebury commented 10 years ago

I'll close this unless we find out that this isn't working as expected.

abendebury commented 10 years ago

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 Documents 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 Documents?

I think it would make more sense if we had one Document per file. That seems to have been the trend anyway.

keien commented 10 years ago

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

abendebury commented 10 years ago

We have one Document per file now, the file name is stored as Document.path.