-
Notifications
You must be signed in to change notification settings - Fork 433
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix BooleanColumn with choices set will always render as if True #301
Conversation
Aside from being ugly, this also doesn't work if the column uses a custom accessor :( |
b110ec3
to
bb07c80
Compare
293534d
to
d9f6f9d
Compare
323c434
to
066a02f
Compare
The current implementation should be more complete. Please tell me what you think @onnokort. |
Code looks good. Let me try to backport these fixes and see whether my application does the right thing with them. Will get back to you on this. Oh, and thank you for this nice software! |
@onnokort thanks. Just noticed that |
066a02f
to
65fc7aa
Compare
This version looks even better. |
b88939f
to
5250177
Compare
Adds test_boolean_field_choices_with_real_model_instances() to tests/columns/test_booleancolumn.py. After a wild-goose chase suspecting Django localization (which was apparently not the problem), this is a test case that will fail for a BooleanColumn representing a model.BooleanField with a choices=... parameter set. The reason that this test fails seems to be somewhere in the code path that handles real model data. The test will pass when just using a pair of mock-up dictionaries. The test will also pass when removing the choices=... parameter from the field = models.BooleanField(...) declaration.
- by using code previously used in BoundColumn.verbose_name - also make BoundColumn.verbose_name use the new implemenation
5250177
to
7a53aec
Compare
@onnokort any news? |
Fix BooleanColumn with choices set will always render as if True
Refs #300, #290
This implements a fix for the failing tests as proposed by @onnokort. It's not really pretty though. What do you think @onnokort?
Also includes the test from #300.
TODO
Accessor.get_field()
inBoundColumn.verbose_name
.