N
N
NyxDeveloper2021-01-18 14:00:46
Django
NyxDeveloper, 2021-01-18 14:00:46

How can I change the upload_to of a FileField to link each file to a separate folder with a ForignKey field name?

In general, a model has a FileField field and a ForignKey field. It is necessary that the files from the FileField are loaded into a folder with the name of the object from the ForignKey. How can this be done?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dr. Bacon, 2021-01-18
@bacon

Homework: Read about it in the docs.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question