Hi folks, I'm working on an internal framework using Pyramid, Colander, and SQLAlchemy, and it's for much more enterprisey apps than I have previously done. We're looking at having a full fledged service layer, and using the ZCA as a DI framework a fair bit. I'm hoping folks can share their opinions on what they've found the best place and way to convert from validated dicts (originating from JSON from angular.js) to SA mapped objects is. I'm using Colander to validate the incoming json, which might be nested two or three levels deep, so after Colander conversion I know the fields in the dicts are ok, but they are still just python dicts.
In the past, I used formencode to do both validation and conversion, but in this case I'm hoping to keep SQLA logic and coupling to a business/model layer that is more insulated from the web request layer so it can be used without issue from non-web-request contexts (rabbitqm jobs, scripts, etc). So I'm imagining right now that outside this business/model layer the web controllers are dealing with json and validating with colander, inside the business/model we are dealing with either proxy objects to the model objects or direct model objects, and somewhere (?) we convert. Any suggestions on what people have found to be good strategies or tools (or reading!) for localizing and controlling the conversion from dicts to mapped objects with relationships would be much appreciated. Or suggestions that I'm just wrong and why. thanks. (apologies for cross post if you already read this on the SQLAlchemy list!) Iain -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/CAN9NcLzWeQRVEAZhU1OZMwrc0fDiahMxQw1W1f6QtjfJe4__LQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
