Django models: A good way to store a multi-line address as a single model field

I am building several models and I need to collect the address. The fact is that I want the address to be collected in one field of the model, but the fields for the address could span several lines.

For instance:

Street:

city:

zip:

state:

Mine is not like them, but you get this idea. Data should be stored in one field of the model.

+4
source share
1 answer

TextField is the perfect choice here:

class TextField([**options])

Large text box. The default form widget for this field is Textarea.

Since it is textareaused as a widget, it "processes" new lines for you.


. , (), , , , , , , .. , .

. :

+5

Source: https://habr.com/ru/post/1539786/


All Articles