Hello all, I'm trying to implement a solution whereby I store Money amounts in the database as both currency and amounts. The best I've come up with is in this gist:
https://gist.github.com/satiani/b20d7e81e48a041d241d61e9aab61be2 It's important for me to be able to do comparisons and aggregate functions on MoneyComposite columns and I've managed to get it working somewhat with a function like func.sum_money() (as can be seen in line 162 in the gist). However, anything more complex than a simple straightforward sum of one column fails. I tried fiddling around with MoneyComparator (line 53) and changing how the type engine works (line 110), but I could not get a working solution. I'd appreciate any help or pointers to help me make this into a more robust solution. Best, Samer -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description. --- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at https://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.