Changes between Version 5 and Version 6 of NewbieMistakes
- Timestamp:
- Sep 28, 2005, 1:06:31 PM (19 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
NewbieMistakes
v5 v6 31 31 32 32 Add a {{{__repr__()}}} function to all your models. Make it a habit so it becomes automatic. 33 34 == Integer & NULLS == 35 36 ==== Problem ==== 37 38 When you have a Field: current_zip = meta.IntegerField(maxlength=5,blank=True) 39 40 django will create a not nullable field in the DB. However leaving the field blank (in admin/web) django will try and insert a NULL value in the DB. 41 42 ==== Solution ==== 43 44 Add null=True: 45 46 current_zip = meta.IntegerField(maxlength=5,null=True,blank=True)