On Mon, Apr 14, 2008 at 11:30 AM, jason kirtland [EMAIL PROTECTED] wrote:
Lukasz Szybalski wrote:
Hello,
Below you can find instructions on how to setup sqlalchemy in virtual
environment.
http://lucasmanual.com/mywiki/TurboGears#head-36fb4094da01b8c28e8bdca803c0f05774eb13b8
On Mon, Apr 14, 2008 at 11:38 AM, jason kirtland [EMAIL PROTECTED] wrote:
Lukasz Szybalski wrote:
On Mon, Apr 14, 2008 at 11:30 AM, jason kirtland [EMAIL PROTECTED] wrote:
Lukasz Szybalski wrote:
Hello,
Below you can find instructions on how to setup sqlalchemy in virtual
Also what would be a syntax to make a same selection using
session.query(th)?
what would you like the ORM query to return ? Object instances ?
currently, using group_by() and such with Query implies you're getting
individual column tuples back using _values(), in which case its
I.e., *all* columns from th are being added to the columns clause of
the select. According to the SQL standard, these names all need to
be added to the GROUP BY as well - if MS-SQL is allowing only a
partial GROUP BY list, thats just poor behavior on the part of MS-SQL
(MySQL has this
ok, I don't think we are on a same page. So let me explain what I
want and maybe unconfused myself on what is a proper way to get data
out of database via sqlalchemy orm style.
Query class should not be confused with the Select class, which
defines database SELECT operations at the SQL
Above statements should result in query like: 'select a,count(a) from
x where b=5,c=6 group by a'
In order to get ORM object I need to use query. (That is what I get
from reading the sentence I quoted)
From the above, what ORM object would you like ? the one which has
a as
Hello,
I am trying to do a simple query which gets id, count(*) group by id,
s=sqlalchemy.select([th.RECORD_NO,sqlalchemy.func.count(th.RECORD_NO)],sqlalchemy.and_(th.APPLIED_TEST==1,th.CODING_DATE=='20080404')).group_by(th.RECORD_NO).execute()
This produces:
SELECT [].[RECORD_NO],
On Wed, Apr 2, 2008 at 6:22 PM, Rick Morrison [EMAIL PROTECTED] wrote:
also of concern is that, nobodys ever going to know they need to use this
parameter when this issue arises.
Well the idea is that this is a workaround for what I suspect is a broken
Unix + pyodbc configuration, not a
On Wed, Apr 2, 2008 at 6:35 PM, Rick Morrison [EMAIL PROTECTED] wrote:
So how would I find out if this is pyodbc or unixodbc?
On Unix, it's both.
pyodbc is the Python DB-API module that provides the DB-API2 interface for
sqlalchemy it in turn relies on an underlying ODBC layer.
unixodbc
On Mon, Mar 31, 2008 at 4:57 PM, Rick Morrison [EMAIL PROTECTED] wrote:
You are correct:
Port=
fixes it.
If you guys could fix this in svn, and point me to some instructions
on how to install sqlalchemy in virtual / home directory that would be
great.
OK, great,
On Tue, Apr 1, 2008 at 9:26 AM, Rick Morrison [EMAIL PROTECTED] wrote:
or sqlalchemy connection string will have to provide some way to add a
driver name to connection string.
sqlalchemy.create_engine('mssql://user:[EMAIL PROTECTED]:1433/?driver=TDS')
That capability, with that
On Tue, Apr 1, 2008 at 10:09 AM, Lukasz Szybalski [EMAIL PROTECTED] wrote:
On Tue, Apr 1, 2008 at 9:26 AM, Rick Morrison [EMAIL PROTECTED] wrote:
or sqlalchemy connection string will have to provide some way to add a
driver name to connection string
Hello,
I am trying to use sqlalchemy from svn.
I have checkout the code in /home/lucas/tmp/sqlalchemy
I installed python-virtualenv
I created my virtualenv
python /usr/lib/python2.4/site-packages/virtualenv.py ENV
I install sqlalchemy
export
On Sat, Mar 29, 2008 at 10:50 PM, Randall Smith [EMAIL PROTECTED] wrote:
Paul Johnston wrote:
Hi,
eng =
sqlalchemy.create_engine(mssql:///?dsn=mydsn,UID=myusername,PWD=mypass,module=pyodbc)
Try this:
eng =
On Mon, Mar 31, 2008 at 9:53 AM, Rick Morrison [EMAIL PROTECTED] wrote:
So what you are saying here is that sqlalchemy will figure out what driver
to use? pyodbc or other?
Sort of. Attempts are made to import appropriate modules until one doesn't
fail. The order is: [pyodbc, mssql,
On Mon, Mar 31, 2008 at 12:21 PM, Rick Morrison [EMAIL PROTECTED] wrote:
It looks to me as if you have unixodbc installed, but don't have a SQL
Server driver installed, or it's named differently.
Unixodbc drivers are here:
http://www.unixodbc.org/drivers.html
I'm not really up on my
On Mon, Mar 31, 2008 at 2:07 PM, Rick Morrison [EMAIL PROTECTED] wrote:
You didn't say how am I supposed to use it in create engine?
http://www.sqlalchemy.org/docs/04/dbengine.html#dbengine_options
Anyway. I went into sqlalchemy/databases/mssql.py
changed the line 791 to:
On Mon, Mar 31, 2008 at 3:50 PM, Rick Morrison [EMAIL PROTECTED] wrote:
I think I remember a Port= in the ODBC connection string.
...would you please try this format on line 816:
connectors.append('Server=%s;Port=%d' % (keys.get('host'),
keys.get('port')))
You are correct:
Port=
fixes it.
On Fri, Mar 28, 2008 at 10:54 PM, Graham Dumpleton
[EMAIL PROTECTED] wrote:
On Mar 29, 11:02 am, Michael Bayer [EMAIL PROTECTED] wrote:
On Mar 28, 2008, at 7:56 PM, john spurling wrote:
I added debugging to get id(session) and len(list(session)). The
session id is unique every
On Tue, Mar 25, 2008 at 9:21 AM, Paul Johnston [EMAIL PROTECTED] wrote:
Hi,
eng =
sqlalchemy.create_engine(mssql:///?dsn=mydsn,UID=myusername,PWD=mypass,module=pyodbc)
Try this:
eng =
sqlalchemy.create_engine(mssql://myusername:mypass@/?dsn=mydsn,module=pyodbc)
Still the same
What is the proper connection string for sqlalchemy to support pool_recycle?
Is there a setting in mod_Wsgi to support this?
sqlachemy.dburi=mysql://username:[EMAIL PROTECTED]:3306/databasename ??
I found the following :
On Mon, Mar 3, 2008 at 8:26 PM, Michael Bayer [EMAIL PROTECTED] wrote:
On Mar 3, 2008, at 9:17 PM, Lukasz Szybalski wrote:
What is the proper connection string for sqlalchemy to support
pool_recycle?
Is there a setting in mod_Wsgi to support this?
its a create_engine option, so
On Jan 17, 2008 3:27 PM, Rick Morrison [EMAIL PROTECTED] wrote:
Adodbapi is Windows-only, you're definitely barking up the wrong tree with
that one.
Pyodbc on Linux is theoretically possible, but I know of no users and have
very little experience myself with it.
Pymssql is supported on
I was able to connect to mssql vi ceODBC driver on linux using unixODBC.
How hard would it be to support ceODBC in sqlalchemy?
--
Instructions to setup dsn on unix:
http://lucasmanual.com/mywiki/TurboGears#head-bab4c0bbfb83fb7c376a8a0cb68841c4e76ad130
apt-get install python-dev
apt-get
On Jan 14, 2008 3:21 PM, Rick Morrison [EMAIL PROTECTED] wrote:
The mssql URI is going to take the same conceptual form as any other
sqlalchemry dburi. The format is documented and available in the SA docs. We
can't give you the exact URI, because it's going to contain things that are
Hello,
I need to extend my turbogears app to get some records from ms sql.
Do you guys know how to setup the ms sql dbi uri to work with sqlalchemy?
What connection uri do I use?
How do I setup unix odbc for it?
Anything else I need?
Can you give me exact instructions?
Thanks,
Lucas
--
Hello,
What is the code for setting up a compound key?
For normal key I would do:
Column('id', Integer, primary_key=True, autoincrement),
For compound key I do?
Column('id', Integer, primary_key=True),
Column('idupdate', Integer, primary_key=True, autoincrement),
In sql form that would be
Hello,
Does assign_mapper have any order_by function available to him after
the object has been mapped?
model.py -
myclass_table = sqlalchemy.Table('myClass', metadata, autoload=True)
class myClass(object):
pass
myclassmapper=assign_mapper(session.context,myClass,myclass_table)
Is this a turbogears app? or just your stand alone app?
On 10/28/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
I just started experimenting with .4 last night, and I'm really
jazzed. The tutorials have been helpful, but I'm struggling to figure
out how to bridge the gap between the
Hello,
I am trying to make a select statement which involves date sorting.
x1=model.User.select(model.User.c.ZIPCODE==zipcode )
now I get a list of 3 records x1[0],x1[1],x1[2]
How can I sort x1 by x[0].c.DATE ?? ASC ?
What would python code for that look like?
or how could I change this to
On 10/30/07, McA [EMAIL PROTECTED] wrote:
Hi all,
thank you for your comments.
I really expected to get comments from more people.
But probably I'm concerned about something you don't have to. ;-)
So, I'll wait.
it seems better to use:
import sqlalchemy
and in code do:
Hello,
I came across this errors when I was working with unicode mysql database.
My record would not get displayed and I would get:
UnicodeDecodeError: 'utf8' codec can't decode byte 0xbf in position
261: unexpected code byte
I was referred to
On 10/23/07, Marco Mariani [EMAIL PROTECTED] wrote:
Lukasz Szybalski wrote:
dev.cfg has
sqlalchemy.dburi=mysql://user:[EMAIL PROTECTED]:3306/dbname
I did this in dev.cfg :
sqlalchemy.convert_unicode = True
sqlalchemy.dburi=mysql://user:[EMAIL PROTECTED]:3306/dbname
now I get
: Lukasz Szybalski [EMAIL PROTECTED]
To: sqlalchemy@googlegroups.com
Sent: Monday, October 22, 2007 3:54:03 PM
Subject: [sqlalchemy] multiple inserts of sqlalchemy instances?
Hello,
I need to save data multiple times in a for loop.
I was trying to do something like this:
You are able to select
On 10/23/07, Michael Bayer [EMAIL PROTECTED] wrote:
On Oct 23, 2007, at 10:16 AM, Lukasz Szybalski wrote:
I am having an issue with a second new.flush()
Does this require multiple sessions for each save?
I can't find any documentation on multiple inserts with assign_mapper.
Lucas
On 10/23/07, Travis Kriplean [EMAIL PROTECTED] wrote:
It appears that this only occurs on macs running a ppc processor, not
an intel processor.
I run into the same problem when I transfer mysql data over to Linux.
Windows mysql is case insensitive while linux version cares what case
it is.
Hello,
I need to save data multiple times in a for loop.
I was trying to do something like this:
You are able to select which group you want to be in: A,B,C,D
for record in userchoice:
new=model.User()
#set some variables
if record.group=='A':
#set some more fields
On 10/10/07, James Brady [EMAIL PROTECTED] wrote:
Hello all,
I'm a newcomer to SA, using it as the ORM for TurboGears at the
moment.
Is there documentation/tutorials/recipes somewhere about how to
properly use SA from TurboGears?
The problem I'm hitting at the moment is how to properly
Hello,
I am saving to my column in this way. How do I get the primary key id
back from database?
z=User()
z.LASTNAME='smith'
z.FIRSTNAME='joe'
z.save_or_update()
z.flush()
How do I get my z.USER_SID which is my primary auto increment key in database.
Lucas
On 9/10/07, Roger Demetrescu [EMAIL PROTECTED] wrote:
On 9/8/07, Lukasz Szybalski [EMAIL PROTECTED] wrote:
On 9/7/07, Paul Johnston [EMAIL PROTECTED] wrote:
Hi,
And if I wanted to select a year and group by year?
select User.Year from User group by User.Year
db.execute
Hi,
And if I wanted to select a year and group by year?
select User.Year from User group by User.Year
db.execute(select([User.Year]) ???
Have a look at http://www.sqlalchemy.org/docs/04/sqlexpression.html
Ok.
Based on documentation.
I do:
import
On 9/11/07, Lukasz Szybalski [EMAIL PROTECTED] wrote:
Hi,
And if I wanted to select a year and group by year?
select User.Year from User group by User.Year
db.execute(select([User.Year]) ???
Have a look at http://www.sqlalchemy.org/docs/04
Hello,
Are there any plans to make the attributes of selected results more
dictionary like?
Currently when you get a record via sqlalachemy
You have an option of
Getting and setting attributes by getattr and setattr.
myresults.c.keys()
then to get the values you have to:
for column in
On 9/6/07, Lukasz Szybalski [EMAIL PROTECTED] wrote:
On 9/6/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
On Thursday 06 September 2007 23:03:35 Lukasz Szybalski wrote:
Hello,
So it seems to me there are two select function that I can use but
they are different
First:
s
ok. So this time I am trying to get data from my widget from database
that has two compound keys, using assign_mapper.
#Initialize:
User_table = sqlalchemy.Table('User', metadata, autoload=True)
class User(object):
pass
usermapper=assign_mapper(session.context,User,user_table)
#get
Hello,
So it seems to me there are two select function that I can use but
they are different
First:
s=Users.select(Users.c.LASTNAME=='Smith')
but when you want to select only two columns via :
s=Users.select([Users.c.LASTNAME, Users.c.FIRSTNAME], Users.c.LASTNAME
=='Smith')
you get an error :
On 9/6/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
On Thursday 06 September 2007 23:03:35 Lukasz Szybalski wrote:
Hello,
So it seems to me there are two select function that I can use but
they are different
First:
s=Users.select(Users.c.LASTNAME=='Smith')
but when you want
Hello,
I am using turbogears with sqlalchemy and assign_mapper.
How do I select one column only when doing a select statement?
d=model.Useraddress()
How do I do: select Address_Sid from Useraddress where User_Sid='30'
This
d.select_by(USER_SID=30)
will do
select * from Useraddress where
Hi,
I am using turbogears with sqlalchemy and assign_mapper.
How do I select one column only when doing a select statement?
Can I ask why you want to do that? Unless you're really speed critical,
selecting them all isn't too bad.
But, if you're set on this, there are two approaches:
Hello,
ok so I got the connection, select statements working using
turbogears, assign_mapper and sqlalchemy.
Now i need to work out the relation.
User has a one to many relation with address, email, accounts.
In reverse: address, email and accounts have many to one...
#here is my table
hello -
you generally use mapper() and relation() to set up how you'd like
your classes to correspond to your table relationships. as far as
compound keys, if they are defined with a primary key constraint you
shouldn't have to worry about them.
---
Ok. So we are using mapper()
ok...correct me if I'm wrong.
#we start by importing
from turbogears.database import metadata, session,bind_meta_data
from sqlalchemy.ext.assignmapper import assign_mapper
from turbogears import widgets, validators
import sqlalchemy
#Then we bound to database
bind_meta_data()
#create a table
Hello,
I am setting up a website with existing database using turbogears.
Database is in mysql.
I am using sqlalchemy but I'm having problems with choosing the mapper?
There is around 20 tables with a lot of foreign key, compound keys and
alternative keys.
Which mapper do I use?
Can you point
101 - 153 of 153 matches
Mail list logo