Changes between Initial Version and Version 1 of Ticket #27720
- Timestamp:
- Jan 10, 2017, 4:36:28 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #27720
- Property Easy pickings unset
- Property Resolution → needsinfo
- Property Status new → closed
- Property Type Uncategorized → Cleanup/optimization
-
Ticket #27720 – Description
initial v1 2 2 3 3 The example project says to instantiate a model in this way: 4 q = Question(**question_text**="What's new?",** pub_date**=timezone.now()) 4 `q = Question(question_text="What's new?", pub_date=timezone.now())` 5 5 6 6 However, if you do something silly like not assigning attributes: 7 q = Question("What's new?", timezone.now()) 7 `q = Question("What's new?", timezone.now())` 8 8 9 9 The model will still instantiate. What's super confusing is that if you forget to type in the attributes, then apply 10 q.save() 10 `q.save()` 11 11 12 You get the bizarre error ValueError: invalid literal for int() with base 10: 'Question'12 You get the bizarre error `ValueError: invalid literal for int() with base 10: 'Question'` 13 13 14 If a model object is created without an assigned attribute and the missing attribute has no default specified, then some type of warning should appear. I wasted about 3 hours today figuring out this dumb mistake; the error message isn' 't related to the initial error.14 If a model object is created without an assigned attribute and the missing attribute has no default specified, then some type of warning should appear. I wasted about 3 hours today figuring out this dumb mistake; the error message isn't related to the initial error.