Try not setting any value to the field, it should be saved with the default value
On Wed, Feb 17, 2016, 2:35 AM Malik Rumi <[email protected]> wrote: > There are a ton of answers to this question out there - if you can wade > through all the ones that refer to forms and not models. The consensus > seems to be that datetime has to be set to both blank=true and null=true. > And when I put in one test row of data manually through the admin, I could > leave my datetime field blank with no problems. But when I tried to load > the 89 other instances through a fixture, I got error after error. > > As near as I can tell, if you leave a json value blank, loaddata says it > isn't a json document. But if you put the empty string, '', Null, None, > "Null", "None" or "0000-00-00" in there, it is rejected as not valid date > format. Therefore, it seems there is no way to do this through a fixture. > My question: Is this correct? If so, is there any alternative to doing it > all manually? Thanks. > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/db367bcf-8cbf-4001-8976-f602e93576d5%40googlegroups.com > <https://groups.google.com/d/msgid/django-users/db367bcf-8cbf-4001-8976-f602e93576d5%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFWa6t%2B4KAx40tR_D0ENcUwL7UHs_QrADQL-eqNYyRnz48z_FA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.

