Hello,

With the following custom type:

class JSONEncodedDict(types.TypeDecorator):
    """ Represents an immutable structure as a JSON-encoded string. """

    impl = types.TEXT

    def process_bind_param(self, value, dialect):
        return json.dumps(value) if value is not None else None

    def process_result_value(self, value, dialect):
        return json.loads(value) if value is not None else None

is there a method to override to automatically transform instances of this class when they're used in a SQL expression (for example an myquery.order_by(col), where col is an instance of JSONEncodedDict)?

Thank you!

Julien

--
No trees were killed in the creation of this message.
However, many electrons were terribly inconvenienced.

--
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 http://groups.google.com/group/sqlalchemy?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to