[sqlalchemy] Re: the return type of conn.execute(text())

2009-01-28 Thread King Simon-NFHD78
use attribute access rather than indexing. Eg. row['your_column_name'] row[your_column] row.your_column_name I imagine this would make it harder to pickle. Simon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

[sqlalchemy] Re: passing tuple argument into sqlalchemy.sql.text string

2009-01-21 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: how to use model.py file across different applications

2009-01-20 Thread King Simon-NFHD78
='prod.cfg', modulename='YOUR_APP_NAME.config') (replace YOUR_APP_NAME with your root-level package name). I don't know what the equivalent is in TG2. Hope that helps, Simon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

[sqlalchemy] Re: Efficient dictificationof result sets

2008-12-19 Thread King Simon-NFHD78
the mapper for a mapped class or object using the class_mapper and object_mapper functions. 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

[sqlalchemy] Re: Create tables with metadata

2008-12-12 Thread King Simon-NFHD78
/MigrateChangeset Hope that helps, Simon -Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of jarrod.ches...@gmail.com Sent: 12 December 2008 07:08 To: sqlalchemy Subject: [sqlalchemy] Re: Create tables with metadata Doesn't get created

[sqlalchemy] Re: returning primary key of object without know what it is called.

2008-12-05 Thread King Simon-NFHD78
(instance) return mapper.primary_key_from_instance(instance) 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] removing instrumentation from a mapped object

2008-12-03 Thread Simon
-to-many relation collection. PyAMF getattr()s the list, which is actually not a list() but a sqlalchemy.orm.collections.InstrumentedList, and subsequently tries to encode all of its _* and __* attributes. Thanks, Simon --~--~-~--~~~---~--~~ You received this message

[sqlalchemy] Re: removing instrumentation from a mapped object

2008-12-03 Thread Simon
On 3 Dez., 18:32, Michael Bayer [EMAIL PROTECTED] wrote: I would also posit that PyAMF's behavior might be inappropriate in   this case.  InstrumentedList is a subclass of list so I don't   immediately see why it would treat it differently. Upon further inspection, this was exactly the case.

[sqlalchemy] Re: relation join problem

2008-12-03 Thread Simon
basically want to setup your relation() as a dict using the lang column as key. Simon On 3 Dez., 16:33, Dom [EMAIL PROTECTED] wrote: Hi i tried the following example, but i cant get the join to work: CREATE TABLE product (    id                INTEGER,    price           NUMERIC(15,2) NOT NULL

[sqlalchemy] Re: New instance ExtraStat with identity key (...) conflicts with persistent instance ExtraStat

2008-11-28 Thread King Simon-NFHD78
primary key (the 'name' column). If 'name' is the only thing that uniquely distinguishes an ExtraStat, you can only have one per name. Hope that helps, Simon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy

[sqlalchemy] Re: ORM mapping with Elixir compared to raw cursor query

2008-11-21 Thread King Simon-NFHD78
/ormtutorial.html#datamapping_joins 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

[sqlalchemy] Re: Info needed regarding the use of cascade

2008-11-18 Thread King Simon-NFHD78
objectbook2 object ...] If you name your backref 'books', then you can use your Stock objects in exactly the same way as you did before. Hope that helps, Simon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

[sqlalchemy] Re: Using deferred with declarative

2008-11-14 Thread King Simon-NFHD78
with declarative? Thanks, Allen Did you see Michael's reply on the same day you sent your original message? http://groups.google.com/group/sqlalchemy/browse_thread/thread/d548138fe d9903ef Simon --~--~-~--~~~---~--~~ You received this message because

[sqlalchemy] Re: select where field=max(field)

2008-11-11 Thread King Simon-NFHD78
of your generous time :-) I wrote a free-standing example that populates a test database. The initial query Simon suggested works and produces the desired output -- the goal is to replicate this with a sqlalchemy query. I also include the join we were working on. Now that the syntax is correct

[sqlalchemy] Re: Removing aggregate function from query results

2008-11-10 Thread Simon
() Cheers, Simon On 10 Nov., 11:35, Ian Charnas [EMAIL PROTECTED] wrote: Hello Alchemy Land! If I have a simple test-case with Bowler objects and City objects, and I want to use func.max and group_by in order to find the highest scorers in each city... I might do something like this: max_score

[sqlalchemy] Re: select where field=max(field)

2008-11-10 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of John Hunter Sent: 10 November 2008 14:07 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] Re: select where field=max(field) On Mon, Nov 10, 2008 at 4:33 AM, King Simon-NFHD78

[sqlalchemy] default=0.0 on Float Column produces `col` float default NULL

2008-11-10 Thread Simon
NULL, ... ) ENGINE=InnoDB DEFAULT CHARSET=latin1 Is that a bug, or am I erring somewhere? Thanks, 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: Memory leak - is session.close() sufficient?

2008-11-10 Thread King Simon-NFHD78
away. 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 [EMAIL PROTECTED] For more

[sqlalchemy] Re: select where field=max(field)

2008-11-10 Thread King Simon-NFHD78
'. This then gets embedded as a subquery into your larger query. It's probably worth printing the SQL produced by each of the queries so that you can see the difference. Hope that helps, Simon --~--~-~--~~~---~--~~ You received this message because you are subscribed

[sqlalchemy] Re: Noob WARNING, sqlalchemy for Desktop Apps?

2008-10-28 Thread Simon
Checkout is built on SQLAlchemy (see http://www.sqlalchemy.org/news.html). Maybe the authors want to share some insight. On 28 Okt., 17:12, Patrick [EMAIL PROTECTED] wrote: I am just learning the basics of Sqlalchemy, I am reading through the O'Reilly book. I was just wondering if anyone is

[sqlalchemy] Re: how to print a constructed query with it's parameters?

2008-10-15 Thread King Simon-NFHD78
is fairly safe from SQL Injection attacks). 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

[sqlalchemy] session becomes sort of transactional after using begin() / commit()

2008-10-10 Thread Simon
, SQLAlchemy wraps all subsequent operations on the same session in BEGIN/COMMIT statements (as observable in MySQL's SQL log), even though I did not call begin() again! Not even close() changes this behavior. Is this intended and if so, how can I make it untransactional again? Thanks, Simon

[sqlalchemy] Re: infinity with mysql backend

2008-10-10 Thread Simon
MySQL apparently is unable to store infinity in float columns, so SA can't do it either. Google have me this: http://forums.mysql.com/read.php?39,220571,220573#msg-220573 On 9 Okt., 18:22, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I have a sqlalchemy table with a float column, and I would

[sqlalchemy] Re: select count group_by where ?

2008-10-10 Thread Simon
: On Fri, Oct 10, 2008 at 10:32 AM, Simon [EMAIL PROTECTED] wrote: The statement looks good in my book...what does system error mean exactly? On 10 Okt., 17:15, Lukasz Szybalski [EMAIL PROTECTED] wrote: Hello, Could anybody tell me what is wrong with this select statement? Records

[sqlalchemy] Re: InnoDB - Foreign Key must be an Index

2008-10-10 Thread Simon
('Referencing', self.metadata, Column('referenced_id', MSInteger(unsigned=True), ForeignKey('Referenced.id'), mysql_engine='InnoDB' ) Simon On 1 Okt., 14:59, GustaV [EMAIL PROTECTED] wrote: Hi all, I'm experiencing an issue on MySQL (5.0.51a) when sqlalchemy

[sqlalchemy] Re: How to turn off UPDATE on child objects when deleting parent object

2008-09-30 Thread King Simon-NFHD78
objects for you. It is described here: http://www.sqlalchemy.org/docs/05/mappers.html#advdatamapping_relation_largecollections_passivedelete Hope that helps, Simon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

[sqlalchemy] Re: M2M relationship

2008-07-14 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 sqlalchemy@googlegroups.com To unsubscribe from this group, send email

[sqlalchemy] Re: AttributeError: 'PropertyLoader' object has no attribute 'strategy'

2008-07-09 Thread Simon Wittber
On Jul 1, 5:53 pm, Michael Bayer [EMAIL PROTECTED] wrote: this means that at least one of the mappers is not fully compiled, but the compiled flag on a mapper which calls upon it is set.This usually implies that the compilation process failed midway, which in all cases would throw an

[sqlalchemy] Re: transactions with multiple potential constraint violations

2008-07-07 Thread Simon
Thanks Mike! Your last suggestion was the best (ans easiest) solution, I guess I just needed someone to point that out to me ;-) Since I want the whole transaction to either succeed or fail, there's no need to use SAVEPOINTs. Cheers, Simon On 3 Jul., 19:55, Michael Bayer [EMAIL PROTECTED

[sqlalchemy] AttributeError: 'PropertyLoader' object has no attribute 'strategy'

2008-07-01 Thread Simon Wittber
/Pylons-0.9.6.2-py2.5.egg/pylons/ wsgiapp.py', line 95 in __call__ response = self.dispatch(controller, environ, start_response) File '/usr/lib/python2.5/site-packages/Pylons-0.9.6.2-py2.5.egg/pylons/ wsgiapp.py', line 236 in dispatch return controller(environ, start_response) File '/home/simon

[sqlalchemy] Re: AttributeError: 'PropertyLoader' object has no attribute 'strategy'

2008-07-01 Thread Simon Wittber
On Jul 1, 3:04 pm, Simon Wittber [EMAIL PROTECTED] wrote: While stress testing my Pylons Web App, SQLAlchemy will occasionally throw the below exception. I forgot to mention that once this exception occurs, my application is hosed and requires a restart. -Sw

[sqlalchemy] Re: Cannot delete persisted object which is not in current session

2008-07-01 Thread King Simon-NFHD78
= Session.object_session(self) db_session.delete(self) See 'How can I get the Session for a certain object' in the FAQ section of http://www.sqlalchemy.org/docs/05/session.html Hope that helps, Simon --~--~-~--~~~---~--~~ You received this message because you

[sqlalchemy] Re: sharding id_chooser query_chooser

2008-06-27 Thread King Simon-NFHD78
dictionary in the example, then you could replace shard_lookup above with a function call that does the query. I hope that helps, Simon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post

[sqlalchemy] Re: text

2008-06-11 Thread King Simon-NFHD78
'%%' instead of '%'. 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: sqlalchemy in virtualenv Instructions

2008-06-10 Thread King Simon-NFHD78
path. If the directory containing your MySQLdb installation is not in there, you have a problem. Hope that helps, Simon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send

[sqlalchemy] Re: select db engine with create_session

2008-06-10 Thread King Simon-NFHD78
hope that helps - I'm sure someone will correct me if I'm wrong. 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: Pre-commit hooks

2008-05-14 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 [EMAIL PROTECTED] For more

[sqlalchemy] Re: schema changes

2008-02-14 Thread King Simon-NFHD78
that it is only in the process of being updated for SA 0.4) 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: Search in object list by field value

2008-02-08 Thread King Simon-NFHD78
-Original Message- From: sqlalchemy@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of maxi Sent: 08 February 2008 14:30 To: sqlalchemy Subject: [sqlalchemy] Re: Search in object list by field value Thanks Simon, I was doing of that manner. Now, is advisable implement

[sqlalchemy] Re: Search in object list by field value

2008-02-08 Thread King Simon-NFHD78
person_one = get_first_match(people, 'id', 1) Hope that helps, Simon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post

[sqlalchemy] Re: How do I Instantiate a class with an Auto-assigned Key ID

2008-02-04 Thread King Simon-NFHD78
' session, where it becomes 1. Hope that helps, Simon -Original Message- From: sqlalchemy@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of jdcman Sent: 04 February 2008 03:04 To: sqlalchemy Subject: [sqlalchemy] Re: How do I Instantiate a class with an Auto-assigned Key ID Ok

[sqlalchemy] Re: Two SqlAlchemy versions installed together

2008-01-23 Thread King Simon-NFHD78
that helps, Simon -Original Message- From: sqlalchemy@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of maxi Sent: 23 January 2008 13:54 To: sqlalchemy Subject: [sqlalchemy] Two SqlAlchemy versions installed together Can I get two SqlAlchemy versions installed together? I need have

[sqlalchemy] Re: Filter by year in datetime column

2008-01-18 Thread King Simon-NFHD78
), Mikropost.c.create_date date(2008, 1, 1)])) Hope that helps, Simon -Original Message- From: sqlalchemy@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: 18 January 2008 13:22 To: sqlalchemy Subject: [sqlalchemy] Filter by year in datetime column Hello, pleas, i have

[sqlalchemy] SQLautocode 0.5.1 relased!

2008-01-10 Thread Simon Pamies
Hi, I'm very pleased to announce a new version of sqlautocode. It features many bugfixes and some refactored code. More information about sqlautocode: http://code.google.com/p/sqlautocode/ Special Thanks to Jason Kirtland - most of the refactoring and bugfixing was done by him! Simon Pamies

[sqlalchemy] Re: Schema display

2008-01-07 Thread King Simon-NFHD78
sqlalchemy_schemadisplay.py is not part of the SQLAlchemy distribution - it's a separate script attached to that wiki page. You can download it from the link at the bottom of the page. Hope that helps, Simon -Original Message- From: sqlalchemy@googlegroups.com [mailto:[EMAIL

[sqlalchemy] Convert JOIN to WHERE for old MySQLs

2007-12-12 Thread King Simon-NFHD78
in dealing with syntax quirks of various databases, so I've got my fingers crossed... Thanks a lot, 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: LIMIT in queries

2007-12-12 Thread King Simon-NFHD78
an empty list, you could use a slice and then call .all() Eg: session.query(User).filter(User.c.id 3)[:1].all() - [] Hope that helps, Simon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post

[sqlalchemy] Re: Column defaults in MapperExtension.after_insert

2007-12-12 Thread King Simon-NFHD78
Michael Bayer wrote: On Dec 11, 2007, at 10:07 AM, King Simon-NFHD78 wrote: I assume the problem is that my date_created column isn't immediately available at the 'after_insert' stage, because it is generated in the SQL INSERT statement, but hasn't been read back from

[sqlalchemy] Re: Convert JOIN to WHERE for old MySQLs

2007-12-12 Thread King Simon-NFHD78
Michael Bayer wrote On Dec 12, 2007, at 9:04 AM, King Simon-NFHD78 wrote: Hi, I'm connecting to an ancient version of MySQL (3.23.58) that (as far as I can tell) doesn't support basic JOIN table ON condition syntax Ie. this gives a syntax error: SELECT * FROM

[sqlalchemy] Re: Convert JOIN to WHERE for old MySQLs

2007-12-12 Thread King Simon-NFHD78
Jason kirtland wrote: King Simon-NFHD78 wrote: Hi, I'm connecting to an ancient version of MySQL (3.23.58) that (as far as I can tell) doesn't support basic JOIN table ON condition syntax Ie. this gives a syntax error: SELECT * FROM productversions pv JOIN

[sqlalchemy] Re: Matching a DateTime-field

2007-12-11 Thread King Simon-NFHD78
, but if you wanted to do any more complicated date calculations, the dateutil library is very good: http://labix.org/python-dateutil Hope that helps, Simon -Original Message- From: sqlalchemy@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Adam B Sent: 10 December 2007 19:15

[sqlalchemy] Iterating over mapped properties

2007-12-11 Thread King Simon-NFHD78
a way to get the name of the property through either of these methods. Is there a generic way that, given a mapped class, I can get a list of the mapped properties with their names? Thanks a lot, Simon --~--~-~--~~~---~--~~ You received this message because you

[sqlalchemy] Column defaults in MapperExtension.after_insert

2007-12-11 Thread King Simon-NFHD78
svilen wrote: On Tuesday 11 December 2007 13:13:37 King Simon-NFHD78 wrote: Hi, I used to be able to iterate over mapper.properties.items() to get the name of each mapped property along with the object that implements it. However, in 0.4.1, trying to do this results

[sqlalchemy] Re: IMPORTANT: Does SA caches objects in memory forever?

2007-12-07 Thread King Simon-NFHD78
MySQLdb.connections16 MySQLdb.converters11 Note that the module names are where the classes are defined, not where they are used, but it may be enough to give you a clue. Hope that helps, Simon --~--~-~--~~~---~--~~ You received this message because you

[sqlalchemy] Re: Sharding strategy based on primary key

2007-12-02 Thread Simon Wittber
On Dec 3, 3:31 am, Michael Bayer [EMAIL PROTECTED] wrote: On Dec 1, 2007, at 11:10 PM, Simon Wittber wrote: Is there any way around this issue, other than explicitly calling an id_generator function, and setting the primary key before the instance gets passed to the shard chooser? I

[sqlalchemy] Sharding strategy based on primary key

2007-12-01 Thread Simon Wittber
I'd like to set up a sharding strategy where shards are chosen based on this code: SHARD_COUNT = 5 databases = dict((i,create_engine('sqlite://shard_%s.db' % i)) for i in xrange(SHARD_COUNT)) def shard_chooser(mapper, instance, clause=None): return instance.primary_key_id % SHARD_COUNT

[sqlalchemy] Re: concurent modification

2007-11-28 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 [EMAIL PROTECTED

[sqlalchemy] Re: fully qualified column names in RowProxy

2007-11-27 Thread King Simon-NFHD78
It may not help in your situation, but did you know that you can also index the row with the Column instances themselves Ie: row[table.c.column] Simon -Original Message- From: sqlalchemy@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Yuri Pimenov Sent: 27 November 2007 16

[sqlalchemy] Re: FYI: SQLAutocode 0.4.1 and 0.5 released

2007-11-14 Thread Simon Pamies
Hi, On Nov 14, 12:44 am, m h [EMAIL PROTECTED] wrote: On Nov 13, 2007 5:14 AM, Simon Pamies [EMAIL PROTECTED] wrote: Hey Simon, I found your code today and started to hack on it to do db migrations. Since it is out of the scope of your project, I'll probably just write my own. But before

[sqlalchemy] Re: FYI: SQLAutocode 0.4.1 and 0.5 released

2007-11-13 Thread Simon Pamies
On Nov 13, 4:53 pm, Werner F. Bruhin [EMAIL PROTECTED] wrote: Gerhard Haering wrote: On Tue, 13 Nov 2007 06:00:25 -0800, Simon Pamies [EMAIL PROTECTED] wrote: Could you perhaps explain the advantages/differences to autoload=True I understand that autoload=True has a pretty high overhead

[sqlalchemy] Re: FYI: SQLAutocode 0.4.1 and 0.5 released

2007-11-13 Thread Simon Pamies
having explicit model definition can come very handy. 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

[sqlalchemy] FYI: SQLAutocode 0.4.1 and 0.5 released

2007-11-13 Thread Simon Pamies
want to directly contribute code then please sign up for the project. Enjoy! -- Simon Pamies --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalchemy

[sqlalchemy] bug with negative slices in orm.query.Query.__getitem__?

2007-11-06 Thread Simon Wittber
Slicing of Query instances can return inconsistent types if negative stop/start values are used. The below patch to tes/orm/query.py demonstrates the issue. When slices with negative stop/start values are used, a list type is returned. When positive values are used, a Query instance is returned.

[sqlalchemy] Re: access mapped object attributes

2007-11-06 Thread King Simon-NFHD78
You may be interested in an older thread, 'How to get list of relations': http://groups.google.com/group/sqlalchemy/browse_thread/thread/ff03af921 eb12acb/861597e8a72f5e6f Simon -Original Message- From: sqlalchemy@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Christophe

[sqlalchemy] Re: Please add some __len__ methods

2007-10-22 Thread King Simon-NFHD78
an unnecessary COUNT query. (I'm not sure why __iter__ gets called before __len__ - I would have guessed it would be the other way round) I can't think of an argument for not having __len__ on Session though. Simon --~--~-~--~~~---~--~~ You received this message because

[sqlalchemy] Re: FYI: AutoCode moved to a new repository

2007-10-13 Thread Simon Pamies
On 12.10.2007, at 18:46, Gaetan de Menten wrote: On 10/12/07, Simon Pamies [EMAIL PROTECTED] wrote: On Oct 12, 10:09 am, Gaetan de Menten [EMAIL PROTECTED] wrote: I couldn't agree more. I mean: shouldn't the autoload part be integrated into SQLAlchemy reflection capability if it can do more

[sqlalchemy] Re: FYI: AutoCode moved to a new repository

2007-10-13 Thread Simon Pamies
type, until a type that appears in types.py is encountered. Nice - will check that and will come back to you if I have questions. Simon PGP.sig Description: This is a digitally signed message part

[sqlalchemy] Re: FYI: AutoCode moved to a new repository

2007-10-12 Thread Simon Pamies
Firebird could be supported by this new autocode. Will try to include this using your help - more via private mail. I did the test with sqlalchemy 0.4beta6, which seems to require some changes to autocode. Thanks a lot for the information. I will try to include this in the 0.5 line. Simon

[sqlalchemy] Re: FYI: AutoCode moved to a new repository

2007-10-12 Thread Simon Pamies
on googlecode and contribute source code. Simon On 10/11/07, Paul Johnston [EMAIL PROTECTED] wrote: Hi, It's really good to see this script progressing. BTW, with SA 0.4, this script should be able to work with no database-specific hacks at all. If you're interesting in implementing

[sqlalchemy] Re: FYI: AutoCode moved to a new repository

2007-10-12 Thread Simon Pamies
for 0.5 are welcome! If all goes well 0.5 can be released with the first stable version of sqlalchemy 0.4. Simon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email

[sqlalchemy] Re: FYI: AutoCode moved to a new repository

2007-10-12 Thread Simon Pamies
give me a short explanation of the MIT license model? 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

[sqlalchemy] Error (InvalidRequestError) when having tables with equally named primary key columns

2007-10-09 Thread Simon Pamies
Hi all, I have the following error: sqlalchemy.exceptions.InvalidRequestError: Column 'DownloadTopic.ID' is not available, due to conflicting property 'ID':sqlalchemy.orm.properties.ColumnProperty object at 0xb761732c when trying to access the topics field defined by the following model. It

[sqlalchemy] Re: Error (InvalidRequestError) when having tables with equally named primary key columns

2007-10-09 Thread Simon Pamies
Hi, I did some more investigation about this subject and found the source for this problem and perhaps some hints for people willing to help out with this problem: Around line 1002 of mapper.py there is a call to prop = self.columntoproperty[column] Why this fails? It seems because two

[sqlalchemy] Re: Error (InvalidRequestError) when having tables with equally named primary key columns

2007-10-09 Thread Simon Pamies
On Oct 9, 4:23 pm, Michael Bayer [EMAIL PROTECTED] wrote: On Oct 9, 2007, at 4:39 AM, Simon Pamies wrote: I have the following error: sqlalchemy.exceptions.InvalidRequestError: Column 'DownloadTopic.ID' is not available, due to conflicting property 'ID

[sqlalchemy] Re: Error (InvalidRequestError) when having tables with equally named primary key columns

2007-10-09 Thread Simon Pamies
On Oct 9, 7:09 pm, Michael Bayer [EMAIL PROTECTED] wrote: On Oct 9, 2007, at 12:33 PM, Simon Pamies wrote: I solved this problem by using autocode (and by the way I created an enhanced version of it called autocode4 - see http://www.sqlalchemy.org/trac/wiki/UsageRecipes/AutoCode

[sqlalchemy] Re: one-to-many access and modification

2007-10-02 Thread King Simon-NFHD78
, the changes should always be reflected in the session. 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: Auto load problem with SQLAlchemy 0.3.10 and mySQL

2007-09-20 Thread King Simon-NFHD78
: stats_table = sa.Table('stats', md, sa.ForeignKeyConstraint(['stats.rid'], ['runs.rid']), autoload=True) Also, I believe mysql table reflection is being completely reworked in 0.4, so the issue might go away. Hope that helps, Simon

[sqlalchemy] LIMIT syntax in old versions of MySQL

2007-09-20 Thread King Simon-NFHD78
/refman/5.0/en/select.html#id3376456 I'm currently monkeypatching MySQLCompiler to use LIMIT offset, limit. Would it make sense for MySQLCompiler to be changed to always use that syntax, since it is supported in more MySQL versions than the standard? Thanks, Simon

[sqlalchemy] Re: Outerjoin with a subset of columns

2007-08-15 Thread King Simon-NFHD78
to use the 'from_obj' parameter for select. Something like: select([s.c.id, f.c.status], from_obj=[oj]) 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: Hierachical data

2007-08-03 Thread King Simon-NFHD78
a family tree with a row for each Person). I don't really think they're relevant in this case. Hope that helps, Simon -Original Message- From: sqlalchemy@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Alexandre CONRAD Sent: 03 August 2007 10:44 To: sqlalchemy Subject

[sqlalchemy] Re: ConcurrentModificationError: Updated rowcount 0 does not match number of objects updated 1

2007-07-31 Thread King Simon-NFHD78
. I don't know you didn't need this before though. Hope that helps, Simon From: sqlalchemy@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Arun Kumar PG Sent: 31 July 2007 09:47 To: sqlalchemy@googlegroups.com Subject

[sqlalchemy] Re: lazy table creation

2007-07-27 Thread King Simon-NFHD78
You want something like this: user_table = Table('users', metadata, Column('userid', String(8))) user_table.create(checkfirst=True) # or # metadata.create_all(checkfirst=True) Documentation is at: http://www.sqlalchemy.org/docs/metadata.html#metadata_creating Hope that helps, Simon

[sqlalchemy] Re: Model to Dictionary

2007-07-24 Thread King Simon-NFHD78
for circular references, and treat x-to-many relationships specially. Simon -Original Message- From: sqlalchemy@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of HiTekElvis Sent: 23 July 2007 23:31 To: sqlalchemy Subject: [sqlalchemy] Model to Dictionary Anybody know a way

[sqlalchemy] Re: Creating where clauses programatically

2007-07-06 Thread King Simon-NFHD78
SQLAlchemy Column objects override the '==' operator (and many others as well) so that python expressions get converted to appropriate SQL expressions. It's mentioned (briefly) here: http://www.sqlalchemy.org/docs/sqlconstruction.html#sql_whereclause Hope that helps, Simon -Original

[sqlalchemy] SQLite Regexp

2007-06-23 Thread Simon Roadkill
() connection.create_function(regexp, 2, self.regexp) results in 'Connection' object has no attribute 'create_function' Is it possible to access the underlying SQLite connection, and use that to create my regexp function? Cheers Simon --~--~-~--~~~---~--~~ You received this message

[sqlalchemy] Re: UniqueObject recipe and turbogears

2007-06-19 Thread King Simon-NFHD78
of the identity_map magic, you will only get one object in the session representing that row anyway. I think a testcase is probably needed - you could try and make a single script that starts two threads and performs operations on UniqueName obects, and see if you can get the same failure. Simon

[sqlalchemy] Autoloading tables on old versions of MySQL

2007-06-14 Thread King Simon-NFHD78
is a nice-to-have feature rather than a necessity, but it's just so convenient :-) Cheers, 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: how to retrieve/update data from/on multiple databases

2007-05-30 Thread King Simon-NFHD78
/unitofwork.html#unitofwork_api_bind). Hope that helps, Simon -Original Message- From: sqlalchemy@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Alchemist Sent: 30 May 2007 14:19 To: sqlalchemy Subject: [sqlalchemy] how to retrieve/update data from/on multiple databases Working

[sqlalchemy] Re: auto-load ForeignKey references?

2007-05-10 Thread King Simon-NFHD78
Max Ischenko wrote: On May 10, 4:38 pm, King Simon-NFHD78 [EMAIL PROTECTED] wrote: You're halfway there with your 'posts' relation. I think if you pass backref='author' in your relation, then WordpressPost objects will get an 'author' property which points back to the WordpressUser

[sqlalchemy] Re: elixir, sqlalchemy myqldb: Error connectiong to local socket

2007-05-09 Thread King Simon-NFHD78
]/django?unix_socket=/Applications/MAMP/tmp/my sql/mysql.sock 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: 'MapperExtension' object has no attribute 'translate_row'

2007-05-04 Thread King Simon-NFHD78
only need to implement the methods that you actually want to override, and you won't have to update your extension class every time new extension methods are added. Hope that helps, Simon -Original Message- From: sqlalchemy@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf

[sqlalchemy] Re: SELECT LIKE

2007-04-13 Thread King Simon-NFHD78
(userinfo.c.name.startswith('Ben')) Or: your_query.select(userinfo.c.name.like('Ben%')) 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 [EMAIL PROTECTED

[sqlalchemy] Re: SELECT LIKE

2007-04-13 Thread King Simon-NFHD78
Disrupt07 wrote @Simon Thanks. But what is your_query? Is it SQLAlchemy or pure SQL? It is a Query object, as described here: http://www.sqlalchemy.org/docs/datamapping.html If you haven't read them yet, I'd recommend working through a tutorial - I found this one really helpful

[sqlalchemy] Re: sqlalchemy.orm.attributes.InstrumentedList

2007-04-12 Thread King Simon-NFHD78
this? (e.g. using the type() function and what shall I import in my controller file?) Thanks. Well, you could import sqlalchemy.orm.attributes, and then when you want to check the type of an object you would say 'if isinstance(your_object, sqlalchemy.orm.attributes.InstrumentedList):' Simon

[sqlalchemy] Re: 'PropertyLoader' object has no attribute 'strategy'

2007-04-11 Thread King Simon-NFHD78
Roger Demetrescu wrote: On 4/11/07, King Simon-NFHD78 [EMAIL PROTECTED] wrote: I've got no idea about the source of the problem, but it would probably be helpful if you could provide stack traces from the exceptions, if that's possible. Do you mean using the traceback module

[sqlalchemy] Re: offset limit on query with relations

2007-04-05 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 [EMAIL PROTECTED] For more

[sqlalchemy] Re: Confused by foreign_keys argument

2007-03-28 Thread King Simon-NFHD78
by changing a single flag. Thanks, Simon From: sqlalchemy@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Michael Bayer Sent: 28 March 2007 17:19 To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] Re: Confused by foreign_keys argument what it cant

[sqlalchemy] Re: Using mapper with custom select creates unneeded subquery

2007-03-22 Thread King Simon-NFHD78
This caught me out a couple of weeks ago, and I've seen a couple of other similar questions as well. You need to add 'correlate=False' to the nested select. I wonder if this should be added to the FAQ? Hope that helps, Simon -Original Message- From: sqlalchemy@googlegroups.com [mailto

[sqlalchemy] Re: Inconsistent results in session.flush()

2007-03-19 Thread King Simon-NFHD78
Michael Bayer wrote: On Mar 17, 2007, at 11:39 AM, Simon King wrote: I had assumed that post_update was only necessary when you are inserting two rows that are mutually dependent, but in this case I wasn't inserting either a ReleaseLine or a Label. I suppose post_update can

[sqlalchemy] Re: Inconsistent results in session.flush()

2007-03-17 Thread Simon King
dependent, but in this case I wasn't inserting either a ReleaseLine or a Label. I suppose post_update can actually have a knock-on affect across the whole dependency graph. Anyway, thanks a lot again for your help, Simon --~--~-~--~~~---~--~~ You received

<    4   5   6   7   8   9   10   >