I am confused about the second answer in this post:
What is the most efficent way to store a list in the Django models?
For the custom field SeparatedValuesField, which directory I should put this py so I can import from custom.fields?
I am confused about the second answer in this post:
What is the most efficent way to store a list in the Django models?
For the custom field SeparatedValuesField, which directory I should put this py so I can import from custom.fields?
That answer assumes that you have a Python file named fields.py
in a package named custom
under your project root. ie:
/project root
---manage.py
---/custom
------__init__.py
------fields.py
You can put your fields.py
under any existing app and import from that location. For example, if you have an app called myapp
, you can put the fields.py
under that package and rewrite your import statement as:
from myapp.fields import SeparatedValuesField