RE: [sqlalchemy] Re: sqlalchemy.exc.NoReferencedTableError: Could not find table with which to generate a foreign key

2011-03-30 Thread King Simon-NFHD78
, Simon -Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com] On Behalf Of 371c Sent: 30 March 2011 16:00 To: sqlalchemy Subject: [sqlalchemy] Re: sqlalchemy.exc.NoReferencedTableError: Could not find table with which to generate a foreign key Actually

RE: [sqlalchemy] trouble with metaclass

2011-03-17 Thread King Simon-NFHD78
help ... I'm not sure if it's the cause of your problem, but you have a typo in tablemeta - your __init__ only has 1 underscore at the beginning... Hope that helps, Simon -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group

RE: [sqlalchemy] In-memory object duplication

2011-03-17 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com] On Behalf Of Jacques Naude Sent: 17 March 2011 12:32 To: sqlalchemy@googlegroups.com Subject: Re: [sqlalchemy] In-memory object duplication Hi, Simon Thanks for the quick response

RE: [sqlalchemy] In-memory object duplication

2011-03-15 Thread King Simon-NFHD78
on, you're adding it to the list a second time. Hope that helps, Simon -- 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

RE: [sqlalchemy] Simple Join failing

2010-10-05 Thread King Simon-NFHD78
: http://www.sqlalchemy.org/docs/core/expression_api.html#sqlalchemy.sql.e xpression.select eg. select([products.c.Group, products.c.Code, price.c.ListPriceEx], from_obj=[prod.join(price)]) Hope that helps, Simon -- You received this message because you are subscribed to the Google

RE: [sqlalchemy] Simple Join failing

2010-10-05 Thread King Simon-NFHD78
Warwick Prince wrote: Hi Simon Thanks for that - I knew it was something wrong with the approach but simply could not pick it!Back to the test bench for another go :-) Cheers Warwick P.S. OK - I have to ask - when and how (why?) do I do the .join on the query? ;-) In SQL

[sqlalchemy] Re: missing types in sqlalchemy.dialects.postgresql

2010-09-11 Thread Simon Wittber
*shrugs*    it might be tricky ensuring that return types for all those operations are adequate, though that might not be necessary assuming psycopg2 does what the end user wants here. My main problem is that table reflection returns the point type as a NullType, and my code needs to know

[sqlalchemy] Re: missing types in sqlalchemy.dialects.postgresql

2010-09-11 Thread Simon Wittber
On Sep 12, 12:46 am, Michael Bayer mike...@zzzcomputing.com wrote: OK, sure.   beyond that though do queries with the column and such do whats expected? Just tried this morning, and it works as expected, create / update statements work fine. It seems psycopg2 takes care of everything. -Sw.

RE: [sqlalchemy] Re: Python's reserved keywords as column names

2010-09-10 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Andrey Semyonov Sent: 10 September 2010 14:35 To: sqlalchemy Subject: [sqlalchemy] Re: Python's reserved keywords as column names On 10 сен, 17:15, King Simon-NFHD78 simon.k

RE: [sqlalchemy] update a relation from its id

2010-09-02 Thread King Simon-NFHD78
-shouldntithaveloadedFoowithid7 Hope that helps, Simon -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options

RE: [sqlalchemy] Session.merge and multiple databases

2010-08-25 Thread King Simon-NFHD78
don't know how you fix this if you want to continue using the version_id_col feature - is there any chance that you could do without it (perhaps by implementing similar functionality in a SessionExtension which only gets attached to the primary session)? Simon -- You received this message because you

[sqlalchemy] Find related classes

2010-08-21 Thread simon
-to-many relationship is not really contained in the schema. Thanks, Simon -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy

[sqlalchemy] Re: Find related classes

2010-08-21 Thread simon
That was exactly what I was looking for. Thanks a lot :-) Simon On 21 Aug., 19:57, Michael Bayer mike...@zzzcomputing.com wrote: On Aug 21, 2010, at 12:05 PM, simon wrote: Hi all, For a given declaratively mapped class in SA 0.6, how do I programmatically find out all other mapped

RE: [sqlalchemy] Which columns changing during orm commit?

2010-08-20 Thread King Simon-NFHD78
documented, but the source is pretty simple. If you only want to know if the attribute has changed, you can call the 'has_changes' method. You can look at the 'added' and 'deleted' properties to get the before and after values. Hope that helps, Simon [1] http://www.sqlalchemy.org/docs/reference

RE: [sqlalchemy] Re: To select only some columns from some tables using session object, relation many-to-many

2010-08-04 Thread King Simon-NFHD78
://www.sqlalchemy.org/docs/mappers.html#deferred-column-loading You can mark certain columns as not to be loaded until they are accessed. This can be done at mapper definition time as well as at query time. Hope that helps, Simon -- You received this message because you are subscribed to the Google

RE: [sqlalchemy] Re: open session blocks metadata create_all method

2010-07-29 Thread King Simon-NFHD78
Hope that helps, Simon -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit

RE: [sqlalchemy] Problem with Joined Table inheritance

2010-07-13 Thread King Simon-NFHD78
that helps, Simon -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group

RE: [sqlalchemy] Using the declarative base across projects

2010-07-08 Thread King Simon-NFHD78
()) # MainScript1.py import ModelClasses db = ModelClasses.initdb(my_connection_string) # access db.Table1, db.Base etc. Hope that helps, Simon -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com

RE: [sqlalchemy] Comparable properties

2010-07-08 Thread King Simon-NFHD78
. For example, you can't use plain Python 'and', or assume that 'self.enabled' evaluates to True or False. I think something like this would work though: @hybrid def is_visible(self): return (self.enabled == True) (self.is_deleted == False) Hope that helps, Simon -- You received

RE: [sqlalchemy] models in different packages, often declaratively defined

2010-07-02 Thread King Simon-NFHD78
know anything about it. Simon -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options

RE: [sqlalchemy] cross-database joins with MySQL

2010-06-29 Thread King Simon-NFHD78
://www.sqlalchemy.org/docs/metadata.html#specifying-the-schema-name (Probably need to use __table_args__ if you are using declarative) Simon -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch

RE: [sqlalchemy] Referential integrity actions are not doing what I want

2010-06-22 Thread King Simon-NFHD78
http://www.sqlalchemy.org/docs/session.html#cascades http://www.sqlalchemy.org/docs/ormtutorial.html#deleting Hope that helps, Simon -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com

RE: [sqlalchemy] help please

2010-06-10 Thread King Simon-NFHD78
' column = getattr(table.c, colname) update = table.update(column=='project-name', values = {test:'program'}) Hope that helps, Simon -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com

RE: [sqlalchemy] SA on MySQL 3.23

2010-06-04 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Michael Bayer Sent: 03 June 2010 19:38 To: sqlalchemy@googlegroups.com Subject: Re: [sqlalchemy] SA on MySQL 3.23 On Jun 3, 2010, at 1:15 PM, King Simon-NFHD78 wrote: Hi

RE: [sqlalchemy] SA on MySQL 3.23

2010-06-04 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Michael Bayer Sent: 04 June 2010 14:42 To: sqlalchemy@googlegroups.com Subject: Re: [sqlalchemy] SA on MySQL 3.23 On Jun 4, 2010, at 6:54 AM, King Simon-NFHD78 wrote

RE: [sqlalchemy] reflecting existing databases with no a priori knowledge of their structure

2010-06-03 Thread King Simon-NFHD78
sqlalchemy.ext.sqlsoup import SqlSoup meta = sa.MetaData('db://user:passw...@host/database') meta.reflect() db = SqlSoup(meta) for table in meta.sorted_tables: cls = db.entity(table.name) print cls print cls.get(1) Hope that helps, Simon Hope that helps, Simon -- You received this message because

[sqlalchemy] SA on MySQL 3.23

2010-06-03 Thread King Simon-NFHD78
function was added in 4.0.2. Is there any way that I can avoid this error? Perhaps with some engine or dialect option that configures the returns_unicode_strings attribute without running the test? Thanks a lot, Simon -- You received this message because you are subscribed to the Google Groups

RE: [sqlalchemy] Re: For each begin_nested() call, a corresponding rollback() or commit() must be issued.

2010-05-28 Thread King Simon-NFHD78
and implement whatever transaction management features you want in your own middleware. Hope that helps, Simon -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group

RE: [sqlalchemy] Use a foreign key mapping to get data from the other table using Python and SQLAlchemy.

2010-05-27 Thread King Simon-NFHD78
still ask SQLAlchemy to use a different name for the column, as demonstrated in http://www.sqlalchemy.org/docs/mappers.html#customizing-column-propertie s Hope that helps, Simon -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group

RE: [sqlalchemy] session lifecycle and wsgi

2010-04-28 Thread King Simon-NFHD78
the old session back again, rather than creating a new one. Simon -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr

RE: [sqlalchemy] declarative commit hook - onCommit()?

2010-04-28 Thread King Simon-NFHD78
classes. Can I still use MapperExtensions? The declarative docs include an example of using a MapperExtension: http://www.sqlalchemy.org/docs/reference/ext/declarative.html#mapper-con figuration Simon -- You received this message because you are subscribed to the Google Groups sqlalchemy group

RE: [sqlalchemy] Storing Nested Lists

2010-04-26 Thread King Simon-NFHD78
', ['x','y','z',['m','n','o']]] If anyone can point me in the right direction, I'd much appreciate it. Thanks. If you make the column a PickleType: http://www.sqlalchemy.org/docs/reference/sqlalchemy/types.html#sqlalchem y.types.PickleType ...it should behave as you want. Simon -- You

RE: [sqlalchemy] Is the mapper must have a primary_key?

2010-04-19 Thread King Simon-NFHD78
that helps, Simon -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit

RE: [sqlalchemy] cls._state / cls._state.get('original') class 'sqlalchemy.orm.attributes.CommittedState'

2010-04-16 Thread King Simon-NFHD78
Hope that helps, Simon -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit

RE: [sqlalchemy] flush(), save(), delete()

2010-04-15 Thread King Simon-NFHD78
not always be what you want. Hope that helps, Simon -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr

RE: [sqlalchemy] further restricting a query provided as raw sql

2010-04-15 Thread King Simon-NFHD78
be too bad. Simon -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit

RE: [sqlalchemy] Re: SQLAlchemy, Twisted, and sAsync

2010-03-26 Thread King Simon-NFHD78
that helps, Simon -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit

RE: [sqlalchemy] recommended declarative method design pattern for sessions

2010-03-22 Thread King Simon-NFHD78
-asked-questions Basically, in your FindFriends method, replace: session = Session() with: session = Session.object_session(self) Hope that helps, Simon -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email

RE: [sqlalchemy] extended use of VALUES command

2010-03-02 Thread King Simon-NFHD78
/sqlalchemy/browse_thread/thread/7f950b628 d7ebee5/4421b272d4c7f91f Hope that helps, Simon -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email

RE: [sqlalchemy] reflecting schema just on a single table

2010-02-24 Thread King Simon-NFHD78
://www.sqlalchemy.org/docs/metadata.html#reflecting-tables Hope that helps, Simon -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr

RE: [sqlalchemy] Oracle Views/DatabaseLink and declarative

2010-02-24 Thread King Simon-NFHD78
() Hope that helps, Simon -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit

RE: [sqlalchemy] Using a arbitrary select mapper/class in a relation - is this allowed?

2010-02-04 Thread King Simon-NFHD78
parameters in the relation were strings? I would be surprised if you got the exception you described (expression 'Country' failed to locate a name ) if you had done that, because SA wouldn't be trying to look up that name. Simon -- You received this message because you are subscribed to the Google

RE: [sqlalchemy] Another tutorial!

2010-02-04 Thread King Simon-NFHD78
thought that you'd actually want to write this: # change the first address prof.addresses[0].email_address = pr...@marvel.com Hope that helps, Simon -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch

RE: [sqlalchemy] Re: Another tutorial!

2010-02-04 Thread King Simon-NFHD78
Mike Driscoll wrote: On Feb 4, 8:30 am, Mike Driscoll kyoso...@gmail.com wrote: On Feb 4, 4:24 am, King Simon-NFHD78 simon.k...@motorola.com wrote: [SNIP] Not a serious blunder, but I think there may be a small mistake in part 2, where you describe updating an email address

RE: [sqlalchemy] Re: Another tutorial!

2010-02-04 Thread King Simon-NFHD78
Mike Driscoll wrote: Thanks Simon! That made sense. I've fixed my example to match what you said. Sorry about that. - Mike No problem. I'm afraid you still have a typo though. You have: addresses[0].email_address = Address(pr...@marvel.com) Whereas you want: addresses[0

RE: [sqlalchemy] Getting useful error messages

2010-02-03 Thread King Simon-NFHD78
class in a place where SA is expecting a column expression. I think we'd need to see the command that you actually typed in to work out what the problem is. Simon -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email

RE: [sqlalchemy] problem when executing multiple insert statements and boolean type

2010-01-29 Thread King Simon-NFHD78
that all subsequent argument dictionaries are compatible with that statement. I think a check has been added in 0.6 so that an exception is raised if you don't follow this advice. Hope that helps, Simon -- You received this message because you are subscribed to the Google Groups sqlalchemy

RE: [sqlalchemy] Map to Arbitrary Select Using Raw SQL

2010-01-27 Thread King Simon-NFHD78
#synopsis You'll have to give it a table name, which will have the effect of defining a Table object even though no such table exists in the database, but I don't think this matters. Then you could use the query that Mike suggested to actually retrieve rows. Hope that helps, Simon -- You

RE: [sqlalchemy] Re: Is it possible to narrow down the generated query in SQLAlchemy if it was created via query_property?

2010-01-26 Thread King Simon-NFHD78
__call__(self, *args, **kwargs): return Session.query(*args, **kwargs) class Comments(Base): query = Session.query_property(query_cls=CallableQuery) ...but I'm still not sure what the point is. Simon -- You received this message because you are subscribed to the Google Groups

RE: [sqlalchemy] any way to pre cook a monster query?

2010-01-26 Thread King Simon-NFHD78
the time... cheers, Chris I think you can use bind parameter objects for this: http://www.sqlalchemy.org/docs/sqlexpression.html#bind-parameter-objects ...and use the query's params method to supply the values. Hope that helps, Simon -- You received this message because you

RE: [sqlalchemy] dynamic_loader

2010-01-25 Thread King Simon-NFHD78
parameter, which you can hopefully pass on to the _do_translation function. I hope that helps, Simon -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group

[sqlalchemy] Re: column label and order by

2009-11-17 Thread King Simon-NFHD78
(tot_amount, x.id). filter(x.datefromdate).filter(x.datetodate). .group_by(x.id) .order_by(tot_amount) .limit(5) Simon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email

[sqlalchemy] Re: bad result when querying for null values (in pk at least)

2009-10-15 Thread King Simon-NFHD78
? You can argue just as easily that the null primary key means the record is incomplete and should not be available. It's an application code issue. According to http://www.sqlalchemy.org/trac/wiki/06Migration the flag will be turned on by default in 0.6 Simon

[sqlalchemy] Re: Declerative Relation trouble

2009-10-15 Thread King Simon-NFHD78
, Simon --~--~-~--~~~---~--~~ 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

[sqlalchemy] Re: Declerative Relation trouble

2009-10-15 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Martijn Moeling Sent: 15 October 2009 15:38 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] Re: Declerative Relation trouble Hi Simon, (I do things a little

[sqlalchemy] Re: Declerative Relation trouble

2009-10-15 Thread King Simon-NFHD78
, (Simon) what version of python are you using? 2.5.1 on Linux Simon --~--~-~--~~~---~--~~ 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

[sqlalchemy] Re: [runs one one installation not on the other] Declerative Relation trouble

2009-10-15 Thread King Simon-NFHD78
Hi All, bad problem I have trouble making relations in SQLA. My code runs on Simons computer but his (and mine) not. I downgraded SLQA from 0.5.6. to 0.5.5 to have the same version, still no luck. I run Python 2.6.2 and Simon 2.5.1 Downgrading Python is a hassle

[sqlalchemy] Re: [runs one one installation not on the other] Declerative Relation trouble

2009-10-15 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Martijn Moeling Sent: 15 October 2009 16:27 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] Re: [runs one one installation not on the other] Declerative Relation trouble

[sqlalchemy] Re: ORM Many to Many Across Two Databases

2009-10-14 Thread King Simon-NFHD78
-the-schema-na me Hope that helps, Simon --~--~-~--~~~---~--~~ 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

[sqlalchemy] Re: Duck-typing style of relations

2009-10-09 Thread King Simon-NFHD78
://techspot.zzzeek.org/?p=13 It even uses Addresses as the example. It's quite old, so some of the syntax will probably need updating, but the basic idea should still hold. Hope that helps, Simon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

[sqlalchemy] Re: Select from multiple databases

2009-10-02 Thread King Simon-NFHD78
for an example. Hope that helps, Simon --~--~-~--~~~---~--~~ 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

[sqlalchemy] Re: Bypass checking to database structure (metadata.create_all)

2009-10-01 Thread King Simon-NFHD78
, Simon --~--~-~--~~~---~--~~ 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

[sqlalchemy] Re: unexpected chained relations and append behaviour

2009-09-24 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Crusty Sent: 24 September 2009 16:16 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] Re: unexpected chained relations and append behaviour Hello Simon, thanks

[sqlalchemy] Re: unexpected chained relations and append behaviour

2009-09-23 Thread King Simon-NFHD78
aren't expecting it is a bad idea. Instead you would use car.parts.count(). Hope that helps, Simon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalchemy

[sqlalchemy] Re: Pre-commit validation spanning multiple tables/ORM classes

2009-09-22 Thread King Simon-NFHD78
of your question, but as far as finding out what the old parent was, could you use the get_history function? http://www.sqlalchemy.org/docs/05/reference/orm/mapping.html#sqlalchemy .orm.attributes.get_history Hope that helps, Simon --~--~-~--~~~---~--~~ You received

[sqlalchemy] Re: getting data from primary keys

2009-09-15 Thread King Simon-NFHD78
= [c for c in table.primary_key.columns] query = sa.select(key_cols) print query.execute().fetchall() Or print connection.execute(query).fetchall() Hope that helps, Simon --~--~-~--~~~---~--~~ You received this message because you are subscribed

[sqlalchemy] Re: How to bypass scoped_session?

2009-09-09 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Eloff Sent: 08 September 2009 21:34 To: sqlalchemy Subject: [sqlalchemy] Re: How to bypass scoped_session? On Sep 8, 3:47 am, King Simon-NFHD78 simon.k...@motorola.com wrote

[sqlalchemy] Re: How to bypass scoped_session?

2009-09-08 Thread King Simon-NFHD78
also included a couple of extra features (the 'query' property and a default __init__) which you can recreate yourself using the examples at http://www.sqlalchemy.org/trac/wiki/UsageRecipes/SessionAwareMapper Hope that helps, Simon --~--~-~--~~~---~--~~ You received

[sqlalchemy] Re: Curious Problem

2009-09-02 Thread King Simon-NFHD78
=True) to prevent the merge from querying the database again. Hope that helps, Simon --~--~-~--~~~---~--~~ 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

[sqlalchemy] Re: from a sqlalchemy table to the corresponding CREATE TABLE sql code

2009-08-26 Thread King Simon-NFHD78
that helps, Simon --~--~-~--~~~---~--~~ 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

[sqlalchemy] Re: Tracking Last Update timestamp for models

2009-08-25 Thread King Simon-NFHD78
to a Column, you should get the behaviour you want. Hope that helps, Simon --~--~-~--~~~---~--~~ 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

[sqlalchemy] Re: negative indexes in query slices?

2009-08-24 Thread King Simon-NFHD78
not sure if it's the sort of thing that SA should do automatically. Simon --~--~-~--~~~---~--~~ 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

[sqlalchemy] Re: ForeignKey on a ForeignKey

2009-08-24 Thread King Simon-NFHD78
the type will be the same as the column that the key is pointing at. eg. sa.Column('child_id', None, sa.ForeignKey'objects.id', ondelete='CASCADE', onupdate='CASCADE'), primary_key=True) Hope that helps, Simon --~--~-~--~~~---~--~~ You received this message because you

[sqlalchemy] Re: table creation oddity

2009-08-21 Thread King Simon-NFHD78
actually modify your object, so it shouldn't appear in session.dirty. (It should appear in session.new though) Hope that helps, Simon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post

[sqlalchemy] Re: index in SA

2009-08-21 Thread King Simon-NFHD78
think it should be fine. ie. class MyClass(Base): __tablename__ = 'my_table' id = Column(Integer, primary_key=True) name = Column(String, nullable=False) type = Column(String, nullable=False) Index('ix_name_type', MyClass.name, MyClass.type, unique=True) Simon

[sqlalchemy] Re: table creation oddity

2009-08-21 Thread King Simon-NFHD78
ever happened is that the sequence has moved on (see the note at the bottom of http://www.postgresql.org/docs/8.1/static/functions-sequence.html) Simon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group

[sqlalchemy] Re: new questions

2009-08-19 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of darkblueB Sent: 19 August 2009 02:58 To: sqlalchemy Subject: [sqlalchemy] Re: new questions Hi Simon thanks for the reply.. Your second part is straightforward.. The first

[sqlalchemy] Re: new questions

2009-08-17 Thread King Simon-NFHD78
layer and not need the ORM. However, if you need to do much more than basic manipulation of the data, the ORM can make your life much easier. Hope that helps, Simon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

[sqlalchemy] Re: renaming columns

2009-08-17 Thread King Simon-NFHD78
something like column.label('newcol'). For example: import sqlalchemy as sa print sa.select([atable.c.acolumn.label('newcol')]) Hope that helps, Simon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy

[sqlalchemy] Backrefs and the identity map

2009-08-03 Thread King Simon-NFHD78
.0x...7ecL [1] Getting master again via query.get Finished So query.get doesn't issue a query, but master.details[0].master does. Is there any way of making the backref use query.get, and thereby use the identity map? Thanks a lot, Simon

[sqlalchemy] Re: Backrefs and the identity map

2009-08-03 Thread King Simon-NFHD78
(sa.Integer, sa.ForeignKey(Master.id)) to master_id = sa.Column(sa.Integer, sa.ForeignKey(Master.__table__.c.id)) ...and now it seems to work! So is this a bug? Thanks, Simon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

[sqlalchemy] Re: Backrefs and the identity map

2009-08-03 Thread King Simon-NFHD78
Michael Bayer wrote: King Simon-NFHD78 wrote: to master_id = sa.Column(sa.Integer, sa.ForeignKey(Master.__table__.c.id)) ...and now it seems to work! So is this a bug? yes, that would be a bug. There are some other scenarios where this kind of thing occurs (lazy clause

[sqlalchemy] Re: Session mapper and Class.query() method

2009-07-27 Thread King Simon-NFHD78
think of for being cautious about cls.query(). Simon --~--~-~--~~~---~--~~ 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

[sqlalchemy] Re: autoload of db view treating columns as Decimal

2009-07-23 Thread King Simon-NFHD78
isjack: 0 When I run your script, I get the correct output, using Python 2.5.1, SA 0.5.4p2, sqlite3 version 2.3.2. Perhaps the bug is in the version of SQLite that you are using? What happens if you run your query using the SQLite command-line tools? Simon

[sqlalchemy] Re: Dynamic making of the where clause

2009-06-26 Thread King Simon-NFHD78
://www.sqlalchemy.org/docs/05/sqlexpression.html#conjunctions Hope that helps, Simon --~--~-~--~~~---~--~~ 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

[sqlalchemy] Re: aggregation with count and webhelpers.paginate

2009-06-22 Thread King Simon-NFHD78
of func.count (untested): hit_count = func.count(m.Hit.id) q = (meta.Session.query(m.Hit.referer, hit_count) .group_by(m.Hit.referer) .order_by(hit_count.desc()) Simon --~--~-~--~~~---~--~~ You received this message because you

[sqlalchemy] Re: Query - column names

2009-06-04 Thread King Simon-NFHD78
that do what you want? Simon --~--~-~--~~~---~--~~ 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

[sqlalchemy] Re: This join does not fill in the collection

2009-05-28 Thread King Simon-NFHD78
of this is at http://www.sqlalchemy.org/docs/05/mappers.html#configuring-loader-strate gies-lazy-loading-eager-loading Hope that helps, Simon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group

[sqlalchemy] Re: This join does not fill in the collection

2009-05-28 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Marcin Krol Sent: 28 May 2009 13:57 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] Re: This join does not fill in the collection Hello Simon, This answered my

[sqlalchemy] Re: mapping class against arbitrary SQL expression

2009-04-17 Thread King Simon-NFHD78
anon)s'. I had hoped that passing the primary_key parameter to mapper would have solved that, but it doesn't. I'm not sure why. Simon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post

[sqlalchemy] Re: mapping class against arbitrary SQL expression

2009-04-17 Thread King Simon-NFHD78
set up properties on the mapped class. I don't know of any way that you can mark a text block as a Selectable. Sorry I can't be more help, Simon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group

[sqlalchemy] Re: Insertion issues

2009-04-03 Thread King Simon-NFHD78
:'), it works for me. Simon --~--~-~--~~~---~--~~ 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

[sqlalchemy] Re: Class.query vs DBSession.query(Class)

2009-02-27 Thread King Simon-NFHD78
for use in the documentation. As the post in the TurboGears thread points out, you can easily add Class.query using the query_property method of the scoped session. Simon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

[sqlalchemy] Re: Separating session and db/models definitions

2009-02-25 Thread King Simon-NFHD78
is loaded in using the sqlalchemy.orm.object_session function. So inside your methods, you should be able to say something like: session = orm.object_session(self) I think that should work no matter what session strategy you are using. Hope that helps, Simon

[sqlalchemy] Re: Creating SQL Expression

2009-02-25 Thread King Simon-NFHD78
('+', a, b) I think that should work. Simon -Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Ashish Bhatia Sent: 25 February 2009 13:26 To: sqlalchemy Subject: [sqlalchemy] Re: Creating SQL Expression The problem is still

[sqlalchemy] Re: altering tables

2009-02-11 Thread King Simon-NFHD78
the tables for which I have altered the definitions using the Table object. I'm using SQLAlchemy '0.5.0beta3', with Python 2.5 on Mac OS X. Thanks, Mike You may like to have a look at the SQLAlchemy Migrate project: http://code.google.com/p/sqlalchemy-migrate/ Hope that helps, Simon

[sqlalchemy] Re: classes in separate files

2009-02-09 Thread King Simon-NFHD78
that make any sense? Simon --~--~-~--~~~---~--~~ 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

[sqlalchemy] Re: Using orderedlist with a secondary table

2009-01-30 Thread King Simon-NFHD78
and Author classes. You can then use the 'associationproxy' extension to hide the details. See the docs at http://www.sqlalchemy.org/docs/05/mappers.html#association-pattern and http://www.sqlalchemy.org/docs/05/reference/ext/associationproxy.html#as sociationproxy Hope that helps, Simon

[sqlalchemy] Re: polymorphic_identity not allowed to be zero for base class?

2009-01-30 Thread King Simon-NFHD78
Would None (ie. SQL NULL) be a valid polymorphic identity? -Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Michael Bayer Sent: 30 January 2009 17:06 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] Re:

[sqlalchemy] Re: polymorphic_identity not allowed to be zero for base class?

2009-01-30 Thread King Simon-NFHD78
, 2009, at 12:19 PM, King Simon-NFHD78 wrote: Would None (ie. SQL NULL) be a valid polymorphic identity? it becomes that issue where we just need some kind of constant to represent THIS_IS_NOT_DEFINED, so that we know when polymorphic_identity is defined or not. it's

<    3   4   5   6   7   8   9   10   >