Re: [sqlalchemy] python customer function

2015-05-11 Thread Jose Soares
thanks for point me to this docs, Jonathan, I'm going to take a look at it. j On 08/05/2015 23:30, Jonathan Vanasco wrote: Would you be able to use a TypeDecorator? http://docs.sqlalchemy.org/en/latest/core/custom_types.html#sqlalchemy.types.TypeDecorator That will allow you to define a

[sqlalchemy] Abort Query

2015-05-11 Thread Warwick Prince
Hi If I execute a query, is there a way to abort that query and release the server before the query completes? e.g. theTable = Table(‘some_large_table’, metadata, autoload=True) query = theTable.select() results = query.execute().fetchall() Is there a way that perhaps another thread, if

Re: [sqlalchemy] possible way of changing the relationship loading strategy in the runtime, on the class level or instance level

2015-05-11 Thread Mike Bayer
On 5/11/15 5:50 AM, Geo wrote: I have a base class node: class Node: parent= relation( 'Node', remote_side=[id], backref=backref( 'children', collection_class=ordering_list('position'), order_by=[position],

Re: [sqlalchemy] Abort Query

2015-05-11 Thread Mike Bayer
I found this: http://stackoverflow.com/a/325528/34549 also Alex Martelli is pretty -1 on the whole idea: http://stackoverflow.com/a/1227814/34549 I'm not sure what else you'd have in mind other than interrupting the thread from the outside. On 5/11/15 2:36 AM, Warwick Prince wrote: Hi

Re: [sqlalchemy] Best practices to test a webapp using scoped_session with defined scope

2015-05-11 Thread Mike Bayer
On 5/11/15 6:21 AM, José Luis Lafuente wrote: Maybe not the best title, but I'll try to explain the problem. I'm using sqlalchemy and pyramid on my app. I'm using a scoped_session on every request: from pyramid.threadlocal import get_current_request Session =

Re: [sqlalchemy] possible way of changing the relationship loading strategy in the runtime, on the class level or instance level

2015-05-11 Thread Geo
I tested on class level and the inspect function, sth like this: inspect(FilmNode).add_property(children_lazy, relation( Film, remote_side=[FilmNode.id], lazy='dynamic', uselist=True ) ) and class FilmNode(Node): children_lazy = relation(

[sqlalchemy] Merge table args from multiple mixins

2015-05-11 Thread Adrian
Is there any clean way to get indexes, constraints etc. from multiple mixin classes? I've tried adding a declared attr for __table_args__ but apparently it follows the normal MRO and only uses one of those methods. On Stack Overflow, I've found http://stackoverflow.com/a/23429892/298479 but