get_readable + Enum, not fetching enum names but values #1239
Day0Dreamer
started this conversation in
General
Replies: 1 comment
-
Yeah, If it's not too late, you could try changing your enum to this instead: class DevelopmentStage(str, Enum):
development = 'development'
staging = 'staging'
release_candidate = 'release candidate'
release = 'release' We could modify @classmethod
def get_readable(cls):
return Readable(
template="%s: %s (%s)",
columns=[
cls.application.name,
cls.plugin_version,
QueryString("CASE WHEN development_stage = 1 THEN 'development' ... END")
],
) Maybe we could add some kind of utility to Piccolo for doing this automatically: @classmethod
def get_readable(cls):
return Readable(
template="%s: %s (%s)",
columns=[
cls.application.name,
cls.plugin_version,
cls.development_stage.as_choices_keys()
],
) What do you think? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Following the documentation
I've managed to get it working.
And yet, when running get_readable()
I get
Cinema4D: 0.0.1 (1)
instead of
Cinema4D: 0.0.1 (development)
And there is no way around that.
Beta Was this translation helpful? Give feedback.
All reactions