A
A
Astrohas2017-02-07 10:40:41
Django
Astrohas, 2017-02-07 10:40:41

What is the best way to override TextField?

Let's say there are a couple dozen models that store HTML in a TextField.
I want to create my custom HTMLField.
How can I redefine it so that when, for example, saving is called, for example, the function and the data change?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sim3x, 2017-02-07
@Astrohas

The field is responsible for validation, the data type in the subd
To override the save, you need to modify the Model
Without understanding how everything works, it’s better not to touch it and write save in each model

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question