Skip to content

0.86.0

Compare
Choose a tag to compare
@dantownsend dantownsend released this 20 Aug 21:55
· 292 commits to master since this release

Added the Email column type. It's basically identical to Varchar, except that when we use create_pydantic_model we add email validation to the generated Pydantic model.

from piccolo.columns.column_types import Email
from piccolo.table import Table
from piccolo.utils.pydantic import create_pydantic_model


class MyTable(Table):
    email = Email()


model = create_pydantic_model(MyTable)
model(email="not a valid email")  # ValidationError!

Thanks to @sinisaos for implementing this feature.