ImperialCollegeLondon/django-drf-filepond

Add 'uploaded_by' field to TemporaryUpload and StoredUpload models

Closed this issue · 4 comments

So I'm trying to associate somehow uploaded files with a user who does the uploading.

First I had an idea to do it via signals on my end and create a "bridge" model, which would link your models with mine. But I can't access the request and user from the model functionality.

Now if we had an optional ForeignKey field uploaded_by to Django "auth.user" that would make relation which would help a lot I think. If user is anonymous, then the field would be None.

Or I could just have another endpoint on my end which would be called from the client once your library replies with 200, which then in turn would create a record in my "bridge" model.

Would love to hear your thoughts :)

P.S. I'm happy to do the PR.

I have no problem with adding an uploaded_by field into the TemporaryUpload and StoredUpload models. Providing it's an optional field, since you've added the authentication functionality, I can see that this is something that it would be good to have in there.

If you create a PR for this, can you target it at the (new) dev branch which I've set up in preparation for a 0.3.0 release.

Many thanks.

All works on my project. But you should check with your tests of course. I would do it myself, but for some reason I can't execute python setup.py test successfully... Getting compilation error in libsodium library.

Thanks for the update. Maybe best to discuss this in a separate issue but what is the specific error you're getting when trying to run python setup.py test?

As you've probably seen, the tests are running through nose so guess this is a problem with installing nose?

Yep, I've created a new issue.