-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ColanderAlchemy throws when encountering synonyms #35
Comments
@ztane Can you post your entire table code so I can test against it? |
@stefanofontanelli Would it make sense to map synonym attributes into the Colander schema as well as the base column properties? There's instances where people make the synonym because they want to do some sort of processing as part of the getter or setter and so it's conceivable that they'd want the Deform field to map to it instead of the base column (which would bypass that functionality). On the flip-side, though, some people use the synonym to create an attribute that gives them some interpretation on the other columns and isn't supposed to be used to set data (example would by having an x,y value for a vector and a synonym that returns the length of the vector). |
@tisdall I think we should add support for synonyms. Users can disable/exclude such fields if they don't want to map in Colander. |
@stefanofontanelli Should we specify the type of the synonym to be the same as the column it's synonym'izing and then expect people to override that if it's not correct? |
Yes, it seems a good solution. On Thu, Nov 7, 2013 at 5:22 PM, tisdall notifications@github.com wrote:
Stefano Fontanelli 465 California Street, Suite 1250 |
@stefanofontanelli The other issue is the functionality of synonym's can also be done with hybrid properties and those have no concept of an Basically, both would be messy if the developer uses the There's also the whole mess of Maybe a better default would be to ignore synonym's and hybrid's, but allow for people to include them somehow via the override argument to |
I reported the bug because I wanted to evaluate ColanderAlchemy with our existing models and CA crashed on the synonym. However, I am not yet sure when and if I want synonyms/hybrid properties in colander schema. |
I think for right now, it'd be prudent to just implement a second try-except with a continue as suggested in the original report. This is actually what the |
@tisdall Yes, it is probably true. On Thu, Nov 7, 2013 at 9:33 PM, tisdall notifications@github.com wrote:
Stefano Fontanelli 465 California Street, Suite 1250 |
…schema - use Colander defaults wherever explicit settings are not given - added tests for confirming documentation examples - added fix and test for issue stefanofontanelli#35 (thrown exception on encountering synonym() ) - made changes to accommodate SQLAlchemy >= 0.9a
This should be fixed in the master now, so I'm going to close the issue. Please test it out and let me know if there are further issues. |
=>
Prolly should just
continue
onAttributeError
there.The text was updated successfully, but these errors were encountered: