Could someone tell me how to simulate the rank() function? I am using
PostgreSQL which does not have this a s a native function.
Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to
I am trying to retrieve unique users from a table using this:
results = sa_session.query(TempScore).group_by(TempScore.user_name)
This unfortunately causes the error below:
There was a problem: (ProgrammingError) column temp_scores.id must
appear in the GROUP BY clause or be used in an
I have numerical values assigned to user in a table, I have query the
table, sort the table in a descending order and then return the value
of a certain user with his position/rank in the table.Could someone
give me a leg up?
Thanks
--~--~-~--~~~---~--~~
You
Thanks! I'll try that out Mike
On Dec 18, 3:55 pm, Michael Bayer [EMAIL PROTECTED] wrote:
On Dec 18, 2007, at 9:49 AM, voltron wrote:
I am trying to retrieve unique users from a table using this:
results = sa_session.query(TempScore).group_by(TempScore.user_name)
This unfortunately
Hi!
import Guard, as in the tutorial does not work. Any ideas?
Easy:installing was problematic, but installing( and python setup.py
install) from the download worked.
I' m using windows python 2.4
Thanks!
On Dec 2, 11:07 pm, Samuel [EMAIL PROTECTED] wrote:
Introduction
Spiff
How does one specify that the auto incrementing field should map to
big serial and not serial?
thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to
Thanks
On Oct 2, 3:54 pm, Ants Aasma [EMAIL PROTECTED] wrote:
On Oct 2, 10:06 am, voltron [EMAIL PROTECTED] wrote: How does one specify
that the auto incrementing field should map to
big serial and not serial?
Use the sqlalchemy.databases.postgres.PGBigInteger datatype for that
field
I have to use PGArray fields, but I think this is only available using
SQlalchemy 0.4. Easy_install only installs 0.4 when it detects Python
2.5. Is there some sort of backport available?
Thanks
--~--~-~--~~~---~--~~
You received this message because you are
not sure what easy_install issue youre having (i only run py 2.4 here).
On Sep 23, 2007, at 4:59 PM, voltron wrote:
I have to use PGArray fields, but I think this is only available using
SQlalchemy 0.4. Easy_install only installs 0.4 when it detects Python
2.5. Is there some sort of backport
Excuse the newbie question, how does one declare a sef-referencing
key? I would like to have fields modified_by and created_by in my
users table, the field should refer back to the user id or user name
in the same table.
Thanks
--~--~-~--~~~---~--~~
You received
),
Column(firstname, String(255)),
Column(lastname, String(255)),
Column(modifiedby_id, Integer, ForeignKey(users.id))
Column(modifiedon,DateTime(timezone=True),
default=func.now()),
On Sep 3, 6:50 pm, voltron [EMAIL PROTECTED] wrote:
Excuse the newbie question, how does
is this correct?
import sqlalchemy.types as types
On Aug 30, 10:07 pm, voltron [EMAIL PROTECTED] wrote:
Hi all
What do I have to import to be able to use the column type TEXT?
--~--~-~--~~~---~--~~
You received this message because you are subscribed
Thanks!
On Aug 30, 10:13 pm, jason kirtland [EMAIL PROTECTED] wrote:
voltron wrote:
Hi all
What do I have to import to be able to use the column type TEXT?
from sqlalchemy import Column, TEXT
Column('mytext', TEXT)
or use 'String' without a length qualifier:
from sqlalchemy
Thanks!
On Jul 2, 10:14 pm, Benjamin Smedberg [EMAIL PROTECTED] wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
voltron wrote:
How does one declare Timestamp fields with timezones? The DateTime
maps to TimeStamp without.
DateTime(timezone=True)
- --BDS
- --
Benjamin Smedberg
aha, this works
resultset = select([links] , links.c.lft.between(5,17),
order_by=links.c.lft).execute()
On Jun 29, 12:00 am, voltron [EMAIL PROTECTED] wrote:
Thanks for your reply,now I dont have errors, but the results are
unexpected, I have a list of booleans if I iterate through the result
I´m not sure if I should ask this here or the Pylons forum:
How does one wrap a query in a transaction when using SAContext? Could
someone post some example code?
Also, I read somewhere that SQL92 defined transactions eliminate the
need to lock tables, is that right?
Thanks
How would would write a query with a BETWEEN?
This does not produce what I want
resultset = select([links, links.c.lft 3, links.c.lft 10]).execute()
I would like all the values lft in table links greater than 3 but
less than 10
I am using PostgreSQL
Thanks
This does not work either :-(
resultset = select([links.c.lft.between(links.c.lft 3,links.c.lft
10) ]).execute()
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email
Thanks Mike, that clears up a few things
On Jun 27, 2:08 am, Mike Orr [EMAIL PROTECTED] wrote:
On 6/26/07, voltron [EMAIL PROTECTED] wrote:
sess = create_session()
allusers = sess.query(User).select()
for user in allusers:
user.group = contractor
print x.name
This adds
How can I construct the clause group by using SQL construction?
Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
To
, voltron [EMAIL PROTECTED] wrote:
Thanks. I did not find this in the docs.
http://www.sqlalchemy.org/docs/sqlconstruction.html
On Jun 27, 4:01 pm, Andreas Jung [EMAIL PROTECTED] wrote:
--On 27. Juni 2007 06:47:37 -0700 voltron [EMAIL PROTECTED] wrote:
How can I construct the clause group
. Juni 2007 12:00:13 -0700 voltron [EMAIL PROTECTED] wrote:
I´m guessing a bit because I still could not find the group_by entry
in the docs
This works:
user.select(links.c.id 3, order_by=[user.c.id]).execute()
but this does not
user.select(links.c.id 3,group_by=[user.c.dept
[EMAIL PROTECTED] wrote:
--On 27. Juni 2007 12:00:13 -0700 voltron [EMAIL PROTECTED] wrote:
I´m guessing a bit because I still could not find the group_by entry
in the docs
This works:
user.select(links.c.id 3, order_by=[user.c.id]).execute()
but this does not
user.select
Thanks Arnar! I´ll prefer to take this off the list since it is only
slightly related to SQLAlchemy.
On Jun 26, 2:28 am, Arnar Birgisson [EMAIL PROTECTED] wrote:
On 6/25/07, voltron [EMAIL PROTECTED] wrote:
Thank you very much for your feedback guys! I was very worried the
whole day. I
Could someone tell me how I would execute this SQL using data mapping?
# SQL
UPDATE users SET group=consultant WHERE group = contractor;
# Mapped object
user_mapper = mapper(User, users)
user = User()
Thanks
--~--~-~--~~~---~--~~
You received this message
would I have to do something like this?
sess = create_session()
allusers = sess.query(User).select()
for user in allusers:
user.group = contractor
print x.name
On Jun 26, 10:40 pm, voltron [EMAIL PROTECTED] wrote:
Could someone tell me how I would execute this SQL using data mapping
I apologize if this is the wrong place to ask this question.
I would like to store and retrieve JSON objects from a database, the
JSON object holds a list of menu items for my site. What would be the
best way to achieve this?
1. Convert the JSON object to Python code using simplejson, pickle
Thank you very much for your feedback guys! I was very worried the
whole day. I did some research and found this:
http://www.evolt.org/article/Four_ways_to_work_with_hierarchical_data/17/4047/index.html
This shows different methods of storing hierarchical data, but I just
did not like the mind
Could someone point me to the documentation about declaring and using
Sequence fields in Sqlalchemy? If there are no docs, could someone
give a rundown? I can imagine how it could be used, but I´ll be
working in the dark without documentation.
Thanks
I have decided to use the global_metada to setup the tables in my app,
in one of the tables, users, I setup an admin account
user = User(john doe, [EMAIL PROTECTED])
how do I flush the the above object? user.flush() does not work in
this context because the User object does not have the
(name: G) has been registered for this thread
On Jun 13, 6:15 pm, Michael Bayer [EMAIL PROTECTED] wrote:
On Jun 13, 2007, at 12:07 PM, voltron wrote:
aha, ok, thanks, but I saw it in the docs, ist it deprecated? Then I
´m in a spot
DynamicMetaData is not deprecated. but when you
almost there:
I put this in base.py
from sqlalchemy import *
metadata = MetaData()
so anywhere I need it I just import:
from gameolymp.lib.base import *
I have no errors, but no databases are created or dropped, this is
what I added to my websetup.py
from sqlalchemy import *
from
I have found a solution which works, but what is the correct way
Michael? I created in base.py:
metadata = DynamicMetaData()
then in my websetup.py :
uri = conf['sqlalchemy.dburi']
engine = create_engine(uri)
metadata.connect(uri)
metadata.create_all()
this works, but you mentioned that I
another thing, g does not work from websetup.py, which I would have
liked
thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
actually, I am iterating through all the databases in the meta
ti = model.meta.table_iterator()
for t in ti:
print create %s ? % t
if raw_input(Choose [Y/n]).lower() in ['y','']:
t.create()
I want to be able to chose which database to create from a pool on
35 matches
Mail list logo