Hi,
If you look at the documentation for the upload_to parameter, you can see
that you can do exactly what you want:
https://docs.djangoproject.com/en/2.0/ref/models/fields/#django.db.models.FileField.upload_to
The upload_to method (in your case "get_user_document_directory") can take
2 parameter
Hey Friends,
I'm having trouble figuring out how to upload a document model to a
dynamically generated location. The following models.py file contains two
models and a helper function
views.py
# I would like the string inputs to be self.bundle.user, and
self.bundle.name where self is the
2 matches
Mail list logo