Skip to content
Discussion options

You must be logged in to vote

@MatMoore I just ran into this as well. From digging into things, it looks when you pass a model along with the update param, it creates a ObjectWithUpdateWrapper which is what actually gets validated:

    def sqlmodel_validate(
        cls: Type[_TSQLModel],
        obj: Any,
        *,
        strict: Union[bool, None] = None,
        from_attributes: Union[bool, None] = None,
        context: Union[Dict[str, Any], None] = None,
        update: Union[Dict[str, Any], None] = None,
    ) -> _TSQLModel:
        if not is_table_model_class(cls):
            new_obj: _TSQLModel = cls.__new__(cls)
        else:
            # If table, create the new instance normally to make SQLAlchemy create

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@nathan-osman
Comment options

@YuriiMotov
Comment options

Answer selected by MatMoore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
4 participants