piccolo-orm / piccolo_admin

A powerful web admin for your database.
https://piccolo-orm.com/ecosystem/
MIT License
316 stars 37 forks source link

Using `Serial` field leads "Input should be a valid integer" when trying to add new row to the table #385

Open metakot opened 5 months ago

metakot commented 5 months ago

piccolo==1.5.0 piccolo_admin==1.3.2 piccolo_api==1.4.0

So I have a table in postgres:

class Example(Table):
    number = Serial()

When I click on "Add row" in admin interface, the request to /admin/api/tables/example/new/ fails with a bunch of traceback ending in a following error:

pydantic_core._pydantic_core.ValidationError: 1 validation error for ExampleOptional
number
  Input should be a valid integer [type=int_type, input_value=DEFAULT, input_type=Unquoted]
    For further information visit https://errors.pydantic.dev/2.6/v/int_type

And that leads to improperly filled contents of the Add Item page.