| 4 | |
| 5 | And there may be another solution. Backwards compatibility may be an issue but I think solvable. Instead of the blank field being a boolean, make it an integer flag: |
| 6 | - blank = models.RESTRICT acts as blank=False now |
| 7 | - blank = models.SET_EMPTY acts as blank=True now and sets field to the 'empty' value |
| 8 | - blank = models.SET_DEFAULT sets a blank value to the field's default value |
| 9 | - blank = models.SET_NULL sets a blank value to the NULL if null=True or raises ValueError if null=False |
| 10 | |
| 11 | If RESTRICT and SET_EMPTY are 0 and 1 respectively the setting can be set coerced to int and be backwards compatible. All in all I think the cleanest solution in the long run. |