1

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?

Community
  • 1
  • 1
wakeupbuddy
  • 971
  • 1
  • 8
  • 17

1 Answers1

2

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 
Selcuk
  • 57,004
  • 12
  • 102
  • 110