Skip to content

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

@metakot

Description

@metakot

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions