django-bitfield
django-bitfield copied to clipboard
Add get_FIELD_active -> [], get_FIELD_display -> str, similar to Djan…
…go's enum helper method (get_FIELD_display).
@zaharazod Thanks for submitting this! Can you explain what this does and why?
Hi! Essentially convenience methods. I was originally using Django's builtin enum fields, which provide a handy get_FIELD_display (string representing current selection). These are two such abstractions that, when I transitioned to bitfield, I found I was doing often. _active returns an array of strings for the currently selected bits, and _display reduces them to a comma-separated string (that last is obviously negotiable). Take all/some/none of it, just saved me a little time.
Any update on this PR? Actually cool feature, any chance if this will be merged?
@mast22 I think a change like this is unlikely to be merged without tests and documentation. (It's also failing CI).
This project's maintainers don't have a huge amount of time for it so I think we're unlikely to do that cleanup work ourselves.