[sqlalchemy] SQLite and Dates

2011-02-28 Thread Nickle
I have the following code. Simple Calendar and list of holidays. If I try and use a Date and datetime.date I get an error as follows Traceback (most recent call last): File H:\workspace\Test\src\stest.py, line 78, in module lon.holidays = [Holiday(lon,

[sqlalchemy] Re: spanning relationship on 3 tables fails

2011-02-28 Thread neurino
I think it was missing a key in foreign_keys: mapper(Sensor, sensors, properties={ 'data': relationship(Data, backref='sensor', foreign_keys=[data.c.id_meas, acquisitions.c.id_cu], primaryjoin=and_(sensors.c.id_meas==data.c.id_meas,

Re: [sqlalchemy] Re: Extending sqlalchemy.schema.Column and metaprogramming traps

2011-02-28 Thread Martijn Moeling
Hi, I know this is an OLD threat but I was searching the group to see If I was not the first one doing this. I am not sure I understand very well what this threat is all about, but I want to extend the Column class for a different reason. I want to add extra functionality to the Column class

[sqlalchemy] Sqlalchemy+Kinterbasdb installation error

2011-02-28 Thread Massi
Hi everyone, I'm trying to access a Firebird (version 2.5) database through Kinterbasdb under windows 7 with python 2.6. I'have download the file: kinterbasdb-3.3.0.win32-py2.6.msi which can be found at this link: http://www.firebirdsql.org/index.php?op=develsub=python, but when I try to

[sqlalchemy] bad sql generated for filter_list using firebird

2011-02-28 Thread bigt
generated sql contains invalid reference to table NONE I don't know where the problem is in Camelot or Sqlalchemy.(latest 0.6 trunk) I am using a Firebird database. I think that the sql derives from the following statements col = getattr( admin.entity, field_name ) query =

[sqlalchemy] UnboundExecutionError: text query with elixir

2011-02-28 Thread David Borsodi
Hello, I'm trying to run the following query with elixir entities: elixir.metadata.bind = 'mysql://root:root@localhost/mutdb' elixir.metadata.bind.echo = True elixir.setup_all(True) t = text(select * from mutations) result = elixir.session.connection().execute(t) and I got:

[sqlalchemy] stucco_evolution 0.33 released!

2011-02-28 Thread Daniel Holth
stucco_evolution is my entry into the crowded 'schema migration' space. For people that like writing their own ALTER TABLE statements, stucco_evolution only concerns itself with passing a SQLAlchemy connection to numbered Python scripts in an evolve/ package, maintaining a (name, number) tuple

Re: [sqlalchemy] Re: Extending sqlalchemy.schema.Column and metaprogramming traps

2011-02-28 Thread Sean Devlin
Well, it sounds like you're taking the wrong approach to me. I'd subclass your ORM objects. Add some simple hooks so that you can use the built in dictionary mixin. Then override update method to apply the validators. Something like this. class ValidatorAspect: validators = {}

Re: [sqlalchemy] SQLite and Dates

2011-02-28 Thread Michael Bayer
On Feb 28, 2011, at 8:49 AM, Nickle wrote: I have the following code. Simple Calendar and list of holidays. If I try and use a Date and datetime.date I get an error as follows Traceback (most recent call last): File H:\workspace\Test\src\stest.py, line 78, in module lon.holidays =

Re: [sqlalchemy] bad sql generated for filter_list using firebird

2011-02-28 Thread Michael Bayer
On Feb 28, 2011, at 7:42 AM, bigt wrote: generated sql contains invalid reference to table NONE I don't know where the problem is in Camelot or Sqlalchemy.(latest 0.6 trunk) I am using a Firebird database. I think that the sql derives from the following statements col =

Re: [sqlalchemy] UnboundExecutionError: text query with elixir

2011-02-28 Thread Michael Bayer
On Feb 28, 2011, at 9:05 AM, David Borsodi wrote: Hello, I'm trying to run the following query with elixir entities: elixir.metadata.bind = 'mysql://root:root@localhost/mutdb' elixir.metadata.bind.echo = True elixir.setup_all(True) t = text(select * from mutations) result =

Re: [sqlalchemy] Re: Extending sqlalchemy.schema.Column and metaprogramming traps

2011-02-28 Thread Michael Bayer
Column can be subclassed but because they are intensively used in complex expression transformations, your custom class may be used in more scenarios than you first anticipate. There are two scenarios where Column objects are copied, and in one case copied into an altered class, so the copying

Re: [sqlalchemy] Find whether a synonym points to a foreign key or a relationship (Looking for your blessing)

2011-02-28 Thread Hector Blanco
Thank you... Of course using all those descriptors for every attribute is a pretty java-esque Yeah... but you know... It's not easy getting rid of the past... And I'm pretty O.C.D, so I lve getters/setters... I'm opened to new experiences, though :-) Any hint, suggestion... whatever! you

Re: [sqlalchemy] Re: Extending sqlalchemy.schema.Column and metaprogramming traps

2011-02-28 Thread Martijn Moeling
On Feb 28, 2011, at 18:21 , Michael Bayer wrote: Column can be subclassed but because they are intensively used in complex expression transformations, your custom class may be used in more scenarios than you first anticipate. There are two scenarios where Column objects are copied, and

Re: [sqlalchemy] UnboundExecutionError: text query with elixir

2011-02-28 Thread David Borsodi
Yes, I also looked and the elixir session is an SA ScopedSession, I'll try the explicit bind. thanks david On Mon, Feb 28, 2011 at 5:58 PM, Michael Bayer mike...@zzzcomputing.comwrote: ssociates the engine wit -- You received this message because you are subscribed to the Google Groups

Re: [sqlalchemy] Sqlalchemy+Kinterbasdb installation error

2011-02-28 Thread werner
On 28/02/2011 16:31, Massi wrote: Hi everyone, I'm trying to access a Firebird (version 2.5) database through Kinterbasdb under windows 7 with python 2.6. I'have download the file: kinterbasdb-3.3.0.win32-py2.6.msi which can be found at this link:

[sqlalchemy] Is Session.execute SQL injection safe?

2011-02-28 Thread Ryan
Can't find anything in the docs as to whether query strings passed into Session.execute are escaped/safe from SQL injection. Any insights? Thanks. -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to

Re: [sqlalchemy] Is Session.execute SQL injection safe?

2011-02-28 Thread Michael Bayer
On Feb 28, 2011, at 5:35 PM, Ryan wrote: Can't find anything in the docs as to whether query strings passed into Session.execute are escaped/safe from SQL injection. Any insights? Thanks. A literal query string is only safe against injection if you ensure that the string contains no

[sqlalchemy] More autocommit and exception-handling questions

2011-02-28 Thread Romy
Getting some conflicting advice on autocommit and wrapping the request in a try/except block on the Tornado mailing list, was wondering what your thoughts are on the issues brought up in the following message and its replies: http://groups.google.com/group/python-tornado/msg/d06a7e244fc9fe29 --

Re: [sqlalchemy] Is Session.execute SQL injection safe?

2011-02-28 Thread Ryan McKillen
Great. Thank you. On Mon, Feb 28, 2011 at 9:37 PM, Michael Bayer mike...@zzzcomputing.comwrote: On Feb 28, 2011, at 5:35 PM, Ryan wrote: Can't find anything in the docs as to whether query strings passed into Session.execute are escaped/safe from SQL injection. Any insights? Thanks. A