some comments... > 2. If there a way, to handle functions in cross-database manner? > I've need to write something like this, for max function which > exists on sqlite but absent in mysql (and if() visa-versa):
- u can at least get that 'if...mysql' out of the actual code, just define a global if_func( usualargs, aggregator=None) and do swicthing inside there. Or, better, define the if_func() as method on the aggregator itself (that is, the mapperExtension?) thus separating somewhat implementation from usage. - Max.onupdate will recurse forever in the else: - the min/max has to be redone not to use maxint (or any other machine/value limit) - one 'if' more.. - why returning a dict if it never contains more than 1 value? it clutters your code a lot... maybe 'return something' or None (or raise something) would be better.. eventualy making some generic updater like: def do_updates( self, instance, table, fields, method, condition): updates = {} for f in fields: r = getattr( f, method)( self, instance) if r is not None: updates[ f.target.name] = r table.update( condition, values=updates).execute() ah, nevermind. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---