[sqlalchemy] Re: SQLAlchemy Tables Definitoons as soaplib Complex Types, help!

2010-04-06 Thread snf
anyone have an idea? this prevents me from developing further. Thank you in advance. On Apr 1, 1:33 pm, snf lukasz.cz...@gmail.com wrote: Hi, I'm trying to implement a soap interface that will allow me to pass pure sqlalchemy objects as a reponse. I'm using the declarative based table

Re: [sqlalchemy] Re: SQLAlchemy Tables Definitoons as soaplib Complex Types, help!

2010-04-06 Thread Kapil Thangavelu
your probably better off creating a parallel hierarchy for soap serialization and then adapting the sqlalchemy types to/from it as needed. if you want to do the metaclass thing, you'll probably need to overide call in your synthentic metaclass and call both the base meta classes call methods.

[sqlalchemy] TypeError: unsupported operand type(s) for +: 'Decimal' and 'float'

2010-04-06 Thread jose soares
Hi all, I'm using Oracle and PostgreSQL with SQLAlchemy and I have some troubles to make the code compatible with both of them. Numeric sa type returns a different type with oracle and pg. For example, in the following table I'm using the Column 'importo' with type Numeric as:

[sqlalchemy] python setup.py develop doesn't install nose

2010-04-06 Thread Chris Withers
...python setup.py test probabyl would, but only for the test run. Might be worth mentioning in README.unittests that you need to manually install nose... cheers, Chris -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group,

Re: [sqlalchemy] Can I log queries from where they're created?

2010-04-06 Thread Jason Baker
On Mon, Apr 5, 2010 at 5:55 PM, Michael Bayer mike...@zzzcomputing.comwrote: I'm unclear on what usage you'd like to see. What I'm trying to do would be roughly equivalent to this: def query_foo(self): logger = logging.getLogger(__name__ + '.' + self.__class__.__name__) query =

Re: [sqlalchemy] TypeError: unsupported operand type(s) for +: 'Decimal' and 'float'

2010-04-06 Thread Michael Bayer
jose soares wrote: Hi all, I'm using Oracle and PostgreSQL with SQLAlchemy and I have some troubles to make the code compatible with both of them. Numeric sa type returns a different type with oracle and pg. For example, in the following table I'm using the Column 'importo' with type

Re: [sqlalchemy] python setup.py develop doesn't install nose

2010-04-06 Thread Michael Bayer
Chris Withers wrote: ...python setup.py test probabyl would, but only for the test run. Might be worth mentioning in README.unittests that you need to manually install nose... this is not clear enough ? As of 0.5.5, unit tests are run using nose. Documentation and downloads for nose are

Re: [sqlalchemy] python setup.py develop doesn't install nose

2010-04-06 Thread Chris Withers
Michael Bayer wrote: Chris Withers wrote: ...python setup.py test probabyl would, but only for the test run. Might be worth mentioning in README.unittests that you need to manually install nose... this is not clear enough ? As of 0.5.5, unit tests are run using nose. Documentation and

Re: [sqlalchemy] Can I log queries from where they're created?

2010-04-06 Thread Michael Bayer
Jason Baker wrote: On Mon, Apr 5, 2010 at 5:55 PM, Michael Bayer mike...@zzzcomputing.comwrote: I'm unclear on what usage you'd like to see. What I'm trying to do would be roughly equivalent to this: def query_foo(self): logger = logging.getLogger(__name__ + '.' +

Re: [sqlalchemy] python setup.py develop doesn't install nose

2010-04-06 Thread Michael Bayer
Chris Withers wrote: Michael Bayer wrote: Chris Withers wrote: ...python setup.py test probabyl would, but only for the test run. Might be worth mentioning in README.unittests that you need to manually install nose... this is not clear enough ? As of 0.5.5, unit tests are run using nose.

[sqlalchemy] inheriting __mapper_args__ and classproperty

2010-04-06 Thread Chris Withers
Okay, so, this is convoluted and painful. We have a project where we use a single table inheritence setup to model reports. Each report has email addresses to send it to, when to run it, etc, but is mapped to an individual class for the implementation of what goes into the report. Now, to

Re: [sqlalchemy] TypeError: unsupported operand type(s) for +: 'Decimal' and 'float'

2010-04-06 Thread jose soares
Michael Bayer wrote: jose soares wrote: Hi all, I'm using Oracle and PostgreSQL with SQLAlchemy and I have some troubles to make the code compatible with both of them. Numeric sa type returns a different type with oracle and pg. For example, in the following table I'm using the Column

[sqlalchemy] UnboundExecutionError when running session.query

2010-04-06 Thread mozillalives
I'm getting the following error when I attempt to run session.query() with a declarative base object UnboundExecutionError: Parent instance Blah is not bound to a Session; lazy load operation of attribute 'attribute' cannot proceed But why? `session` is a brand new session I've just started,

[sqlalchemy] Infinite recursion in 0.6beta3

2010-04-06 Thread Christoph Zwerschke
I think I just found a regression in 0.6. When evaluating the following SQL expression sum(2*(func.length('bla'),)) with SQLAlchemy 0.6beta3 I get a RuntimeError: maximum recursion depth exceeded With SQLAlchemy 0.5 this used to work, except that it was translated to 0 + length('bla')

[sqlalchemy] envbuilder setup for sqlalchemy

2010-04-06 Thread Jason Baker
Hello, Just in case anyone can use this, I've created a sample envbuilder file that will create a virtualenv with sqlalchemy installed from hg. The file is here: http://github.com/jasonbaker/envbuilder/blob/master/examples/sqlalchemy/.env To use it: 1. Install the development version of

[sqlalchemy] Re: UnboundExecutionError when running session.query

2010-04-06 Thread mozillalives
Oh, forgot to mention versions SA @ 0.5.6 Python 2.5 On Apr 6, 11:08 am, mozillalives mozillali...@gmail.com wrote: I'm getting the following error when I attempt to run session.query() with a declarative base object UnboundExecutionError: Parent instance Blah is not bound to a Session;

Re: [sqlalchemy] TypeError: unsupported operand type(s) for +: 'Decimal' and 'float'

2010-04-06 Thread Michael Bayer
jose soares wrote: Michael Bayer wrote: jose soares wrote: Hi all, I'm using Oracle and PostgreSQL with SQLAlchemy and I have some troubles to make the code compatible with both of them. Numeric sa type returns a different type with oracle and pg. For example, in the following table

[sqlalchemy] Re: UnboundExecutionError when running session.query

2010-04-06 Thread mozillalives
Whoops, cancel that request - I found out where the error was occurring. It was happening when I iterated over the query results. Guess I need to pay more attention to the traceback next time :) On Apr 6, 11:22 am, mozillalives mozillali...@gmail.com wrote: Oh, forgot to mention versions SA @

Re: [sqlalchemy] Infinite recursion in 0.6beta3

2010-04-06 Thread Michael Bayer
Christoph Zwerschke wrote: I think I just found a regression in 0.6. When evaluating the following SQL expression sum(2*(func.length('bla'),)) with SQLAlchemy 0.6beta3 I get a RuntimeError: maximum recursion depth exceeded With SQLAlchemy 0.5 this used to work, except that it was

Re: [sqlalchemy] inheriting __mapper_args__ and classproperty

2010-04-06 Thread Michael Bayer
Chris Withers wrote: class ComputedMapperArgs: @classproperty def __mapper_args__(cls): if cls.__name__=='Person': return dict(polymorphic_on=cls.discriminator) else: return

[sqlalchemy] Re: SQLAlchemy Tables Definitoons as soaplib Complex Types, help!

2010-04-06 Thread snf
Thanks for reply. I want to stick to the metaclass solution. Please verify if I understood you correctly: class MainMeta(meta1class, meta2class): def classmaker_init(cls, name, bases, dct): super(meta1class, cls).__init__(name, bases, dct) super(meta2class, cls).__init__(name,

[sqlalchemy] Joined Table Inheritance and Mapping:Child classes do not pick up maps to other tables

2010-04-06 Thread Josh Winslow
I'm attempting to use joined table polymorphism for various types of activities. Activities all share a few common features, a location, a reference number, time, etc. but some have some further attributes. When I set up my map like so: mapper(Activity, activities,

Re: [sqlalchemy] Joined Table Inheritance and Mapping:Child classes do not pick up maps to other tables

2010-04-06 Thread Michael Bayer
On Apr 6, 2010, at 3:56 PM, Josh Winslow jwins...@gmail.com wrote: I'm attempting to use joined table polymorphism for various types of activities. Activities all share a few common features, a location, a reference number, time, etc. but some have some further attributes. When I set up

[sqlalchemy] Re: Joined Table Inheritance and Mapping:Child classes do not pick up maps to other tables

2010-04-06 Thread Josh Winslow
On Apr 6, 4:27 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Apr 6, 2010, at 3:56 PM, Josh Winslow jwins...@gmail.com wrote: I'm attempting to use joined table polymorphism for various types of activities.  Activities all share a few common features, a location, a reference number,

[sqlalchemy] PostgreSQL hstore custom type?

2010-04-06 Thread Kyle Schaffrick
Greetings, I'm looking into using PostgreSQL's hstore type in a SQLAlchemy project, and before I possibly reinvent the wheel I was wondering if anyone has/knows of an implementation of an hstore custom type for SQLA? I'm basically just interested in simply mapping a stand-alone attribute