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
m>
wrote:
> On Fri, Jul 28, 2017 at 1:46 PM, Samer Atiani <sati...@gmail.com> wrote:
> > The way I'm handling this is by creating a TypeDecorator with the
> following
> > function:
> >
> >
> > def bind_expression(self, value):
> > "&q
The way I'm handling this is by creating a TypeDecorator with the following
function:
def bind_expression(self, value):
"""
The objective of this is to force MySQL to deal with bind
parameters as
decimals rather than as strings. MySQL for some insane reason
Hello All,
Assume you have a CompositeProperty that depends on two properties,
'property_1' and 'property_2' and assume the constructor method for this
property class does something like this:
class ExampleCompositeProperty(object):
def __init__(self, property_1, property_2):
if property_1 is
Definitely simpler :)
On Thu, Jan 19, 2017 at 16:23 mike bayer <mike...@zzzcomputing.com> wrote:
On 01/19/2017 01:53 PM, Samer Atiani wrote:
> I would like to allow some of the CompositeProperty columns I'm building
> to get their names dynamically, in a manner that mirrors how
I would like to allow some of the CompositeProperty columns I'm building to
get their names dynamically, in a manner that mirrors how columns get their
names in sqlalchemy's declarative mapper. The best way I found to implement
this behavior is to do the following:
class
Hello,
I'm trying to write a custom REPLACE expression that compiles differently
on MySQL vs sqlite, namely it would look like REPLACE INTO in mysql and
INSERT OR REPLACE in sqlite. I implemented it like so:
class ReplaceInto(ValuesBase):
def __init__(self, table, values=None):