Added support for null=True (and default=None) to BitField class.#14
Added support for null=True (and default=None) to BitField class.#14eswenson1 wants to merge 1 commit into
Conversation
to include a test for null=True and default=None, and to test for various manipulations of model instances with None as the value of the BitField.
|
Should we really allow them to stay NULL? My concerns around that are you wont be able to access foo.key_name, you'd have to say if foo and foo.key_name in many areas |
|
Hi David, I believe I accidentally sent a partially composed message -- sorry 'bout In our application, we need to be able to distinguish between a field whose So, at least in our application, we require a value to be able to take on To be fair, one could make the argument that the real parallel to the Now, to your point of notational convenience and awkwardness of code: I We're happily using the modified implementation now. However, if you Take care, and thanks for taking the time to look into this. -- Eric On Tue, Mar 20, 2012 at 5:02 PM, David Cramer <
|
Also added a test that checks creation and manipulation of model instances with a BitField that uses null=True and default=None.
Prior to this change, the following model definition would not work:
the resulting instances would ignore the default None, and have fields with BitHandler instances with all bits disabled.
Now, BitField fields can either be None (null) or BitHandler instances.