Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3959900
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T02:47:15+00:00 2026-05-20T02:47:15+00:00

As I understand from this database design question , you should use nullable fields

  • 0

As I understand from this database design question, you should use nullable fields sparingly and make a weighed decision each time on whether it would be better to rethink data design instead.

But let’s say in some particular case the resolution is to allow a text field to contain an empty value. Say, there’s user table and there’s short_bio column that is represented by the TextField in Django and is not mandatory. It doesn’t make sense to create a separate user_bio table, right?

Now the question is, should the empty value be an empty string or null marker? What are pros and cons for each option? Are there any specifics in how Django works with database that can make difference?


It should be noted that django-lint currently reports on CharField and TextField instances with null=True.

Conversely, ‘storing an empty string for a field left blank is seen as a Bad Idea’ by some developers.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T02:47:15+00:00Added an answer on May 20, 2026 at 2:47 am

    I think that when ’empty string’ means ‘no value’, the empty string should be used in order to avoid mixing nulls and blanks meaning the same thing (e.g. in searching or comparing: in some DBMS you can’t compare NULL to NULL directly, you must use the IS NULL operator).

    Using the empty string will also make easier to use it ‘as is’ in reports and other stuffs where the ‘short_bio’ is used without passing throug the DOM (e.g. using objects.values('short_bio')), without converting Null in ”.

    Moreover, Django docs state:

    Avoid using null on string-based fields such as CharField and TextField unless you have an excellent reason. If a string-based field has null=True, that means it has two possible values for “no data”: NULL, and the empty string. In most cases, it’s redundant to have two possible values for “no data;” Django convention is to use the empty string, not NULL.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The question is how database design should I apply for this situation: main table:
i don't understand this example from the doc : the timeIntervalSinceNow method should show
I'm trying to understand this line from an strace on linux: sendto(10, \24\0\0\0\26\0\1\3\233\274\362O\0\0\0\0\0\0\0\0, 20,
I try to understand this example from jquery api in this snippet var tags
I don't understand the last line of this function from Programming Perl 3e .
I am trying to understand this inline assembly code which comes from _hypercall0 here
SELECT * FROM mytable WHERE match(fieldname) against('spa') I don't understand why this query doesn't
From web pages like this one, http://www.jsftutorials.net/components/step5.html I understand that the binding attribute in
I cannot understand this query? select @:vfOutBalance+@:vfHSSubTotal+@3+orpartpayment,@:vfOutBalance+@:vfHSSubTotal from or_equip_upgrd_id what does @3 mean?
I found the code from the net in which i cant understand this line:-

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.