Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Should I set a maximum length for journal content in the database?

I am using Django and PostgreSQL to do a Journal Application. What I’m thinking of is not limiting the length of the journal context so that the user can write as much as they want. What will happen if I don’t set a maximum length? Should I set a maximum length for journal content in the database?

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

There is already a type for that: a TextField [Django-doc], this will normally use the database limit, which is for practical reasons "unlimited". It will also work with a textarea as form widget by default.

For a CharField [Django-doc], you are required to pass a max_length, if not the constructor will reject it.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading