J
J
JRazor2015-08-15 16:27:34
Django
JRazor, 2015-08-15 16:27:34

Django or Flask: store default values ​​in page or database?

Hello all toasters!
I am developing a website. There are a lot of empty defaults on the profile page. There are two options:

  • Store default values ​​in the database (not always convenient, the field can be no more than 6 characters, and the default value exceeds this length)
  • Pass default values ​​to the page and process them with {% if bla-bla %} {% else %}

Which of the options is more correct, promising in terms of code support? Or is it done in a completely different way?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sim3x, 2015-08-15
@sim3x

I can’t say for sure about alchemy, but in jang the default value in the model can be a lambda.
Those are not stored in the database
. And the wording itself

not always convenient, the field can be no more than 6 characters, and the default value exceeds this length
looks ridiculous

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question