| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
⚠️ Please install the Codecov Report❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
@@ Coverage Diff @@
## master #469 +/- ##
==========================================
- Coverage 90.84% 90.83% -0.02%
==========================================
Files 104 104
Lines 6913 6915 +2
==========================================
+ Hits 6280 6281 +1
- Misses 633 634 +1 ☔ View full report in Codecov by Harness.
|
Sorry, something went wrong.
| if isinstance(column, (Decimal, Numeric)): | ||
| value_type: t.Type = pydantic.condecimal( | ||
| if column._meta.choices: | ||
| value_type: t.Type = column._meta.choices |
There was a problem hiding this comment.
@dantownsend Strings work well. Adding these two lines code becomes compatible with Piccolo Admin (with field propertyTitle).
# pydantic.py line 242
if column._meta.choices:
params["title"] = column._meta.choices.__name__In Piccolo Admin change this line to v-bind:type="property.type" and this line to class Gender(str, enum.Enum): and everything work well in admin and openapi docs.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Related to #467
Just a prototype at the moment.
If a Piccolo column has choices, we can use the choices Enum as the Pydantic type. For example:
It would become this Pydantic model:
The problem is the JSON schema it generates is quite complex, and Piccolo Admin doesn't currently understand $ref values:
So the options are: