[sqlalchemy] Re: Auto load problem with SQLAlchemy 0.3.10 and mySQL

2007-09-20 Thread jason kirtland
Noufal wrote: > On Sep 20, 10:34 pm, Noufal <[EMAIL PROTECTED]> wrote: > [..] >> I create the tables using SQLAlchemy. I'll send you the output in a >> day, I'm away from the machine where this code is right now. > > The output of the create table column looks like this > > CREATE TABLE `stats`

[sqlalchemy] Re: Import problem

2007-09-20 Thread Goutham Lakshminarayan
Bingo! easy_install -u sqlalchemy worked. (Btw wouldn't mind knowing what was wrong wen i first installed it :O. The folder wasnt empty and easy_install.pth did have a refernece to the egg). Thnx a lot! regards Goutham --~--~-~--~~~---~--~~ You received this messa

[sqlalchemy] Re: Import problem

2007-09-20 Thread Jose Galvez
is the folder empty? if it is the install didn't work regardless of what the output says. I would delete the egg, and also edit easy_install.pth to remove the reference to it and try to reinstall it again with easy_install -U sqlalchemy if that doesn't work make sure that there is a reference to

[sqlalchemy] Re: Auto load problem with SQLAlchemy 0.3.10 and mySQL

2007-09-20 Thread Noufal
On Sep 20, 10:34 pm, Noufal <[EMAIL PROTECTED]> wrote: [..] > I create the tables using SQLAlchemy. I'll send you the output in a > day, I'm away from the machine where this code is right now. The output of the create table column looks like this CREATE TABLE `stats` ( `sid` int(11) NOT NULL

[sqlalchemy] Re: Import problem

2007-09-20 Thread Goutham Lakshminarayan
Its an import error. The module doesnt exist. There is only a folder called SQLAlchemy-0.3.10-py2.5.egg(This is a folder,not an EGG file) in my site packages. Nothing else related to sqlalchemy is there in the sitepackages.The installation went fine. The problem is there is no sqlalchemy folder or

[sqlalchemy] Re: Import problem

2007-09-20 Thread Jose Galvez
what error do you get is you enter import sqlalchemy Jose Goutham Lakshminarayan wrote: > This might trivial to most of u but Iam having problems importing > sqlalchemy on windows. The installation went without a problem but > when i went to site packages directory there was a > SQLAlchemy-0.3.10

[sqlalchemy] Import problem

2007-09-20 Thread Goutham Lakshminarayan
This might trivial to most of u but Iam having problems importing sqlalchemy on windows. The installation went without a problem but when i went to site packages directory there was a SQLAlchemy-0.3.10-py2.5.egg folder and no folder called sqlalchemy or a .py file. Moreover i cant import sqlalchemy

[sqlalchemy] Re: LIMIT syntax in old versions of MySQL

2007-09-20 Thread jason kirtland
King Simon-NFHD78 wrote: > Hi, > > The ancient version of MySQL that I am connecting to (3.23.58) doesn't > support the syntax 'LIMIT OFFSET ' syntax. Instead, it > uses LIMIT , . This is described in the docs, but it > doesn't say what version introduced the more standard syntax: > > http://de

[sqlalchemy] Re: Auto load problem with SQLAlchemy 0.3.10 and mySQL

2007-09-20 Thread Noufal
> Did you originally create the tables through SQLAlchemy or are you > reflecting an existing schema? In either case I'd need to see the > output of SHOW CREATE TABLES for the problem table to make a diagnosis. I create the tables using SQLAlchemy. I'll send you the output in a day, I'm away

[sqlalchemy] Re: SQLAlchemy: like and security (sql injection attacks)

2007-09-20 Thread Felix Schwarz
Hi, thank you very much for your fast and helpful comments! fs smime.p7s Description: S/MIME Cryptographic Signature

[sqlalchemy] Re: SQLAlchemy: like and security (sql injection attacks)

2007-09-20 Thread jason kirtland
Felix Schwarz wrote: > Hi, > > I have a question related to sql injection when using a clause like > this: "User.c.username.like('%' + userinput + '%')" > > What restrictions do I have to put on the variable userinput? Of course, > I will ensure that is no percent character ('%') in userinput.

[sqlalchemy] Re: SQLAlchemy: like and security (sql injection attacks)

2007-09-20 Thread Paul Johnston
Hi, >I have a question related to sql injection when using a clause like >this: "User.c.username.like('%' + userinput + '%')" > > SQLAlchemy uses a bind parameter for the value, so there's no chance of full-blown SQL injection. There is, as you've identified, a risk of "like pattern injectio

[sqlalchemy] session.dirty, not behaving as I expected...

2007-09-20 Thread Alexandre Conrad
Hi all, I'm in a scenario where I have to deal with a playlist and it's slots (a slot is an entry in the playlist). I'm trying to detect if changes were made on an slot. If so, I would update my playlist's timestamp: # Query the slot to be updated. c.slot = model.Slot.query.get(id) # Get the

[sqlalchemy] Re: Feature suggestion: Description attribute in Tables/Columns

2007-09-20 Thread jason kirtland
Rick Morrison wrote: > This is Python, after all, and it would be trivial to simply put > whatever attribute you want on a Table, Column or any SA object. > > SA would just need to stay out of the way and agree not to use a certain > attribute like "description" or "userdata", or whatever. The

[sqlalchemy] Re: Nested selects

2007-09-20 Thread Bruno Rezende
Thanks! I'll try it! On 9/20/07, Rick Morrison <[EMAIL PROTECTED]> wrote: > > Yes, those are called subqueries; they're fully supported by SA. Your > query above has a couple of items of note: > > a) it's a correlated subquery: the inner query references items in the > outer query. (supported by

[sqlalchemy] Re: Nested selects

2007-09-20 Thread Rick Morrison
Yes, those are called subqueries; they're fully supported by SA. Your query above has a couple of items of note: a) it's a correlated subquery: the inner query references items in the outer query. (supported by SA) b) it's a self-join: the inner query and outer query reference the same table. (a

[sqlalchemy] Re: Auto load problem with SQLAlchemy 0.3.10 and mySQL

2007-09-20 Thread jason kirtland
Noufal wrote: > Hello everyone, > I've recently picked up SQLAlchemy for a project that I'm working > on. I couldn't get a version newer than 0.3.10 (admin bureaucracy) and > have to use this. > > I create two tables like so > run_table = sa.Table('runs',md, >

[sqlalchemy] Nested selects

2007-09-20 Thread Bruno Rezende
Hi all, is it possible to do nested selects in sqlalchemy? For example, something like: select p.id from mytable as p where p.number = (select max(number) from mytable as p2 where p2.attribute = p.attribute) I'm using sqlalchemy 0.3.10 regards, Bruno --~--~-~--~~~---

[sqlalchemy] Re: Feature suggestion: Description attribute in Tables/Columns

2007-09-20 Thread Rick Morrison
This is Python, after all, and it would be trivial to simply put whatever attribute you want on a Table, Column or any SA object. SA would just need to stay out of the way and agree not to use a certain attribute like "description" or "userdata", or whatever. --~--~-~--~~~

[sqlalchemy] Re: Insert select results

2007-09-20 Thread Rick Morrison
It's on the to-do. This would be a great place to start hacking on SA if you're interested, it's a feature that's been requested a few times now. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To

[sqlalchemy] Re: SQLAlchemy: like and security (sql injection attacks)

2007-09-20 Thread Rick Morrison
Don't build SQL strings up from fragments that contain user input -- it's what makes the application subject to SQL injection in the first place. Safest would be to use a bound parameter for the literal. See here for details: http://www.sqlalchemy.org/docs/04/sqlexpression.html#sql_everythingelse

[sqlalchemy] SQLAlchemy: like and security (sql injection attacks)

2007-09-20 Thread Felix Schwarz
Hi, I have a question related to sql injection when using a clause like this: "User.c.username.like('%' + userinput + '%')" What restrictions do I have to put on the variable userinput? Of course, I will ensure that is no percent character ('%') in userinput. Is that enough (assuming that SQL

[sqlalchemy] Insert select results

2007-09-20 Thread Timur Izhbulatov
Hi all, Is there any way to do things like INSERT INTO t1 (SELECT c1, c2, c3 FROM t2); using SQLAlchemy API? Seems that Select and ResultProxy objects can't be used with _Insert.execute() Thanks, Timur --~--~-~--~~~---~--~~ You received this message becaus

[sqlalchemy] LIMIT syntax in old versions of MySQL

2007-09-20 Thread King Simon-NFHD78
Hi, The ancient version of MySQL that I am connecting to (3.23.58) doesn't support the syntax 'LIMIT OFFSET ' syntax. Instead, it uses LIMIT , . This is described in the docs, but it doesn't say what version introduced the more standard syntax: http://dev.mysql.com/doc/refman/5.0/en/select.html

[sqlalchemy] Re: Auto load problem with SQLAlchemy 0.3.10 and mySQL

2007-09-20 Thread King Simon-NFHD78
Noufal wrote: > > > I create two tables like so > run_table = sa.Table('runs',md, > sa.Column('rid', sa.Integer, > primary_key=True), > sa.Column('cmdline', sa.String(250)), > sa.Column('hostname', s

[sqlalchemy] Auto load problem with SQLAlchemy 0.3.10 and mySQL

2007-09-20 Thread Noufal
Hello everyone, I've recently picked up SQLAlchemy for a project that I'm working on. I couldn't get a version newer than 0.3.10 (admin bureaucracy) and have to use this. I create two tables like so run_table = sa.Table('runs',md, sa.Column('rid', sa.Integ