[sqlalchemy] Joining on Two Databases on Same Database Server Using SQLSoup

2009-03-06 Thread noah.gift

Is it possible to do something like this with SQLSoup, or plain
SQLAlchemy:

SELECT p.Shot, s.fr_range_in, s.fr_range_out, s.cut_duration FROM
Production.Production p JOIN Shots.Shots s on p.ShotID = s.shot_ID;

I can intuitively figure out how that would work with SQLSoup because
you pass in a connection string that requires a database.  In my case
I have two databases on the same database server, and I want to join
on them in SQLAlchemy if possible.

--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] sqlalchemy exceptions

2007-05-08 Thread noah.gift

I am trying to use the following code to handle an exception in
Turbogears, but it does not grab the SQLError:

please note I did a:
from sqlalchemy.exceptions import SQLError

def save(self, name=None, email=None, password=None,
password_confirm=None,
 **kw):
try:
u = User(user_name=name, display_name=name, email=email,
password=password)
raise redirect(/registered)

except SQLError:
flash(That account already exists.)


--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---



[sqlalchemy] Re: sqlalchemy exceptions

2007-05-08 Thread noah.gift



On May 8, 1:58 pm, Michael Bayer [EMAIL PROTECTED] wrote:
 On May 8, 2007, at 1:23 PM, noah.gift wrote:





  I am trying to use the following code to handle an exception in
  Turbogears, but it does not grab the SQLError:

  please note I did a:
  from sqlalchemy.exceptions import SQLError

  def save(self, name=None, email=None, password=None,
  password_confirm=None,
   **kw):
  try:
  u = User(user_name=name, display_name=name, email=email,
  password=password)
  raise redirect(/registered)

  except SQLError:
  flash(That account already exists.)

 i think youre confusing a pattern from SQLObject here.  creating a
 new object doesnt write any changes to the database in sqlalchemy.

Your right.  I wasn't sure of how much magic was occuring with
Turbogears, but I really do like that I have to be explicit even
inside of Turbogears.
Forgive the dumb question, but what is the proper SQLAlchemy
recommended way to deal with a situation like this.
Should I see if the object already exists first, or be lazy and try to
write to the database and attempt to catch the exception.
I love to read, so if you can point me to some examples on situations
like this it would be very helpful.

Noah




--~--~-~--~~~---~--~~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~--~~~~--~~--~--~---