Re: makemigration detect error

2017-05-08 Thread Melvyn Sopacua
On Friday 05 May 2017 20:08:01 Er. Rv Ranga wrote: > python manage.py makemigrations blog > > You are trying to add a non-nullable field 'body' to post without a > default; we can't do that (the database needs something to populate > existing rows). > Please select a fix: > 1) Provide a one-off

Re: makemigration detect error

2017-05-06 Thread ad...@tradom.ca
Hello, I know somewhat about this situation. I was a beginner some months ago :-) the situation is : you change something in a model (add a non-nullable field) when you send « makemigrations" the ORM needs to get a value for the new fields just because it’s non-nullable before modifying anythi

Re: makemigration detect error

2017-05-06 Thread Vijay Khemlani
You are adding a non-null field to a table, so the existing rows from that table need a value to put in it to enforce the non-null rule. If you select 1, you type that value, and it is used for all previously existing rows in the table. On 5/6/17, Er. Rv Ranga wrote: > python manage.py makemigr

makemigration detect error

2017-05-06 Thread Er. Rv Ranga
python manage.py makemigrations blog You are trying to add a non-nullable field 'body' to post without a default; we can't do that (the database needs something to populate existing rows). Please select a fix: 1) Provide a one-off default now (will be set on all existing rows with a null valu