[sqlalchemy] Re: Table updates using data mapping

2007-06-27 Thread voltron
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 the

[sqlalchemy] Re: Column name mapping problem in 0.3.7

2007-06-27 Thread Graham Stratton
Hi Rick, I still have rowcount issues on the latest svn. Also, is 'money' a native type? I'm currently setting ischema_names['money'] = MSNumeric Thanks, Graham On Jun 6, 6:34 pm, Rick Morrison [EMAIL PROTECTED] wrote: Hi Graham, There's a good chance that only you and I are using

[sqlalchemy] backref definitions

2007-06-27 Thread remi jolin
Hello, Suppose we have the Address and User mappers as they are defined in SA's documentation I was wondering if the 2 syntax bellow were equivalent : 1/ User.mapper.add_property('addresses', relation(Address, backref=BackRef('user', **user_args)), **addresses_args) 2/

[sqlalchemy] Always free - no trial versions or spyware, Ready to use

2007-06-27 Thread shivani
Hi, Your best pictures are now on display. Pick a favorite photo as your desktop picture or add several into your screensaver rotation. What better way to enjoy your photographic genius at your desk? Click Below Now www.chulbul.com/picasa.htm Enjoy this small piece of Software...

[sqlalchemy] Group by?

2007-06-27 Thread voltron
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

[sqlalchemy] Re: backref definitions

2007-06-27 Thread Michael Bayer
On Jun 27, 2007, at 6:00 AM, remi jolin wrote: Hello, Suppose we have the Address and User mappers as they are defined in SA's documentation I was wondering if the 2 syntax bellow were equivalent : 1/ User.mapper.add_property('addresses', relation(Address, backref=BackRef('user',

[sqlalchemy] Re: backref definitions

2007-06-27 Thread remi jolin
le 27.06.2007 15:36 Michael Bayer a écrit: On Jun 27, 2007, at 6:00 AM, remi jolin wrote: Hello, Suppose we have the Address and User mappers as they are defined in SA's documentation I was wondering if the 2 syntax bellow were equivalent : 1/

[sqlalchemy] Naming and mapping

2007-06-27 Thread klaus
Hi, I'm curious why mapped Selectables are named the way they are. Consider the following code: from sqlalchemy import * metadata = BoundMetaData(...) class Data(object): pass table1 = Table(table1, metadata, Column(id, Integer, nullable=False, primary_key=True),

[sqlalchemy] Re: backref definitions

2007-06-27 Thread Michael Bayer
On Jun 27, 10:54 am, remi jolin [EMAIL PROTECTED] wrote: I first tried to add the backref on only one side but the relationship was not bi-directional ; user.addresses.append(a) updated address.user but not the other way, that's why I added it both sides. try not to use add_property() for

[sqlalchemy] Re: difficult query

2007-06-27 Thread Michael Bayer
On Jun 27, 9:54 am, ltbarcly [EMAIL PROTECTED] wrote: I'm wondering how I would implement the following query. I have 3 tables A, B, C. Each table has a many-to-many relationship to the other two through an association object, call these AB, AC, BC. If I want to select all the B's

[sqlalchemy] Re: Naming and mapping

2007-06-27 Thread Michael Bayer
On Jun 27, 11:05 am, klaus [EMAIL PROTECTED] wrote: table = join(table1, table2, table1.c.id == table2.c.fk).select(table2.c.id == 42).alias(s) # This prints ['id', 'fk']. Shouldn't there be three columns? And where is the prefix s? joins have a different behavior than select(), in

[sqlalchemy] Re: Group by? Still a problem

2007-06-27 Thread voltron
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]).execute() What should be the right syntax? Thanks On Jun 27, 4:07 pm,

[sqlalchemy] Re: Group by? Still a problem

2007-06-27 Thread Andreas Jung
--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(links.c.id

[sqlalchemy] Re: Group by? Still a problem

2007-06-27 Thread voltron
Then it must be a bug, I still get an error _executebuild\bdist.win32\egg\sqlalchemy\engine\base.py 602 SQLError: (ProgrammingError) column user.id must appear in the GROUP BY clause or be used in an aggregate function On Jun 27, 9:09 pm, Andreas Jung [EMAIL PROTECTED] wrote: --On 27.

[sqlalchemy] column_prefix with synonym

2007-06-27 Thread jdu
It seems that both options don't work in common: dates = Table('dates', meta, Column('date', Date, primary_key=True) ) mapper(MyDate, dates, column_prefix='_', properties=dict( date = synonym('_date'), ) produces with 0.3.8: ArgumentError: WARNING: column 'date' not being added due to

[sqlalchemy] Re: column_prefix with synonym

2007-06-27 Thread Michael Bayer
On Jun 27, 2007, at 3:48 PM, jdu wrote: It seems that both options don't work in common: dates = Table('dates', meta, Column('date', Date, primary_key=True) ) mapper(MyDate, dates, column_prefix='_', properties=dict( date = synonym('_date'), ) produces with 0.3.8:

[sqlalchemy] Future of migrate project

2007-06-27 Thread Allen Bierbaum
Is anyone currently keeping the migrate project up to date or are there any other efforts to provide similar functionality? We have a rather large project where we started using migrate with SA because we wanted a robust way to track database modifications and apply then to production databases.

[sqlalchemy] Re: Future of migrate project

2007-06-27 Thread Michael Bayer
Based on the non-responsiveness on the migrate ML, I think migrate needs someone to take it over at this point. I would favor a rewrite that doesn't rely upon any monkeypatching within SA (which would have prevented the breakage upon version change), and I also had agreed earlier to allow ALTER

[sqlalchemy] Re: Group by? Still a problem

2007-06-27 Thread Huy Do
I think you should listen to that error message. user.id must appear in the group by or be used in an aggregate function i.e count, sum, avg etc. The other problem you are using the ORM interface. You should be using the SQL select. I'm not sure what you are trying to achieve, but your

[sqlalchemy] Re: Group by? Still a problem

2007-06-27 Thread voltron
Could you point me to the url where this example is? I wonder why order_by and other things work with the ORM then and group_by left out Thanks On Jun 28, 1:19 am, Huy Do [EMAIL PROTECTED] wrote: I think you should listen to that error message. user.id must appear in the group by or be used

[sqlalchemy] Re: Group by? Still a problem

2007-06-27 Thread Eric Ongerth
On Jun 27, 4:34 pm, voltron [EMAIL PROTECTED] wrote: Could you point me to the url where this example is? I wonder why order_by and other things work with the ORM then and group_by left out Here is where to find the group_by method in the documentation: From the main table of contents,

[sqlalchemy] Re: Group by? Still a problem

2007-06-27 Thread Michael Bayer
On Jun 27, 2007, at 7:34 PM, voltron wrote: Could you point me to the url where this example is? I wonder why order_by and other things work with the ORM then and group_by left out also you need to understand the behavior of group by, as far as SQL. postgres in particular, as well as

[sqlalchemy] Re: Future of migrate project

2007-06-27 Thread Evan Rosson
I'm still around; unforunately, I'm afraid I lack the time/motivation to put much more into migrate. I've no objections to someone else taking over the project, if anyone's interested. For what it's worth, there's a mostly-finished svn branch that removes monkeypatching, no changes to SA