Changes between Initial Version and Version 1 of Ticket #23405, comment 14
- Timestamp:
- Sep 8, 2016, 11:16:43 AM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #23405, comment 14
initial v1 5 5 <MarkusH> truecoldmind: what has blank to do with database default anyway? 6 6 <MarkusH> but I agree, you need to check for null 7 * ojii has quit (Quit: Leaving)8 7 <truecoldmind> I'm thinking due to https://docs.djangoproject.com/en/dev/ref/models/fields/#null. Docs recommends to not use `null=True` for char and text fields. It may not be obvious that `blank=True` without `null` will give empty string, but, we should definitely not set empty string as default if neither `blank` nor the `null` was specified 9 8 <MarkusH> blank is only used for form validation, iirc 10 9 <truecoldmind> Yup. But, if no `blank` and `null` specified, user must specify default by himself. We are now returned to South behavior (it sets empty string if only `blank` was specified), but I don't know how to make thing to be obvious 11 10 <MarkusH> truecoldmind: which turns us back to one of my previous questions: Django's migrations are not equal to South's. Do we want to have the same behavior here? 12 * tonebot has quit (Remote host closed the connection)13 * tonebot (~nodebot@ec2-54-161-155-85.compute-1.amazonaws.com) has joined #django-dev14 11 <truecoldmind> MarkusH, it will be good (reasons are explained in https://code.djangoproject.com/ticket/23405#comment:5). Due to https://docs.djangoproject.com/en/dev/ref/models/fields/#blank, `blank` is not necessarily associated with forms 15 12 <truecoldmind> So I think that check in deconstuct "if self.blank and not self.null and self.default is NOT_PROVIDED" will be right … … 18 15 <MarkusH> but yes, that should work 19 16 <truecoldmind> MarkusH, okay, thanks for conversation. I will do more research about how changes in deconstruct will affect migrations and update PR later 20 <MarkusH> Thank you for tackling the issue21 17 }}}