[Question] Is there a way to get the display instead of the value for a field with a choices parameter associated with it?
See original GitHub issueHello, everyone.
In the following code:
class Model(db.Model):
field = pw.Charfield(
choices=[1, 'foo']
)
def __unidoce__(self):
return self.<api call I don't know about>
I would like to print foo instead of 1. The ORM implements a way to achieve this?
Thanks in advance.
Issue Analytics
- State:
- Created 9 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Dynamic or Conditional display of Jenkins job's parameters ...
In this example MY_PARAM is a parameter in the Jenkins job. As long as you put 'MY_PARAM' in the Active Choices 'Referenced Parameters'...
Read more >Use parameters to ask for input when running a query
Create a parameter query · Create a select query, and then open the query in Design view. · In the Criteria row of...
Read more >Use Parameters to Make Views More Interactive - Tableau Help
Tip: Instead of typing each value in the list, click Add values from > Parameters to add them from Select Column 1 Heading....
Read more >How to put a value in a selection screen parameter
Hi,. Either u can pass the default value in parameter or u have to hard code in where clause of select statement i.e...
Read more >Using a control with a parameter in Amazon QuickSight
The values display alphabetically in the control, unless there are more ... For parameter controls, the child control must be linked to a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s just Python, there’s no magic there. One easy way to accomplish this is to write something like this:
Ok, your solution works. Before it I have tried:
…but this not work. Your answer works as I expected.
Thank you very much and thanks for your work on peewee.