Skip to content

sqlaclhemy column of type sqlalchemy.dialects.postgresql.UUID throws exception #153

Description

@berkio3x

This is my sqlalchmey model, but it throws the below exception.

from sqlalchemy.dialects.postgresql import  UUID

class Test(Base):
    __tablename__ = "test"

    id = Column(
        UUID,
        server_default=sqlalchemy.text("uuid_generate_v4()"),
        primary_key=True,
        info={'form_field_class': TextField}, # <-- This should have been rendered as textfiled ?
    )

Form:

        class ObjectForm(ModelForm):
            class Meta:
                model = Test

exception:
wtforms_alchemy.exc.UnknownTypeException: Unknown type 'UUID()' for column 'organization_id'
This is a very common data type used while using postgres backend in sqlalchemy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions