Open ztane opened 9 years ago
All good points. Would you like to provide a pull request that implements some of these suggestions? I'm fine with you just extending the code to accommodate those additional types.
At the very least, we should probably eliminate that claim in the docs.
Maybe this PR #69 will solve your problem. You can override the standart strategy form generation, using their own field. I'm trying to do now in sacrud_deform.
glancing over this again... Isn't this solved with using the "info" value on the column to define a typ
? Something like:
json = Column(JSON,
info={'colanderalchemy': {
'typ': colander.Text(),
}})
The documentation claims the following:
Now, I wanted to add new types to
get_schema_from_column
(we are using postgresql JSON and TEXT[] and didn't want ColanderAlchemy to crash on these. If we need to add these, we need to copy paste the entireget_schema_from_column
definition and add lines there. Furthermore, sinceSQLAlchemySchemaNode
itself is hardcoded in theget_schema_from_relationship
, the subobjects cannot use our subclass, so we need to forkget_schema_from_relationship
too. All in all, easier just to fork the entire codebase.Now, the solution could be to break the get_schema_from_column into parts that have overrideable methods - for example consult a method instead of throwing a
NotImplementedError
, and use an overrideable method to create new SQLAlchemySchemaNodes for relationships, etc.