Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

MarkusH
Copy link
Member

@MarkusH MarkusH commented Oct 6, 2014

@charettes
Copy link
Member

Buildbot, test this please.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assertIsNone

@MarkusH MarkusH force-pushed the ticket23609 branch 3 times, most recently from f6a28f9 to 7600bb3 Compare October 7, 2014 11:07
@MarkusH MarkusH changed the title Fixed #23609 -- Changed the way the table is remade in SQLite if a NULL constraint has changed Fixed #23609 -- Changed behavior when dropping a NULL constraint to update rows with NULL to default Oct 7, 2014
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you setting it to None here? It looks like it's not used between this line and line #581.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we didn't

@loic
Copy link
Member

loic commented Oct 8, 2014

Patch is looking good, but shouldn't the questioner play a part in this? The same way that adding a NOT NULL field triggers it, see ask_not_null_addition.

@MarkusH
Copy link
Member Author

MarkusH commented Oct 8, 2014

I added a commit to integrate the migration questioner.

@MarkusH
Copy link
Member Author

MarkusH commented Oct 8, 2014

Tests failed because of some checkout issue

@collinanderson
Copy link
Contributor

buildbot, retest this please.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a little too familiar wording? Also a suggestion of what one may want to do would be helpful, for instance: (e.g. deal with existing NULL using a separate RunSQL or RunPython operation).

@MarkusH MarkusH force-pushed the ticket23609 branch 2 times, most recently from 7d06735 to 02bbb7f Compare October 9, 2014 11:33
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is print_function needed? it doesn't appear in the rest of the code base.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it's a bit defensive, it helps ensuring that behavior is always identical.

print("hello",) would give different results in PY2 and PY3 for instance.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the right way to support Python 2 and Python 3. See PEP 3105. I mean, I can drop it again, but I don't see the reason for that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think the position of the newline should be altered -- above it seems to be so that the line fits in a standard size terminal window -- here the first line is too long -- should break after "non-nullable" instead.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also message above doesn't have quotes around the model name.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once (field_name, model_name) expand I doubt it'll fit in 80chars even above.

Good catch on the quote inconsistency.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree on the quotes, but I'm with @loic on the word wrap.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm yea, I wonder if we should just remove the newlines then and let the terminal window wrap the lines. It looks funny now to have a newline after the semicolon. Actually would django.utils.text work to automatically insert the newlines?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we could use django.utils.text.wrap() in the questioner, but I'd do that in a separate commit / pull request.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"operation in the new migration file before the AlterField operation" (to give better guidance?)
need newlines in the this message

…olumn into a NOT NULL one due to existing rows

Thanks to Simon Charette, Loic Bistuer and Tim Graham for the review.
@loic
Copy link
Member

loic commented Oct 9, 2014

Merged in f633ba7 and 71988ed. Thanks!

@loic loic closed this Oct 9, 2014
@MarkusH MarkusH deleted the ticket23609 branch October 9, 2014 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants