Re: [sqlalchemy] Caching intermediate results in baked queries

2018-11-16 Thread Martijn van Oosterhout
t;> s1 = select([b1]) > >>> print(s1) > SELECT :param_1 AS anon_1 > >>> s1.compile().construct_params({'%(140062366895800 param)s': 5}) > {'param_1': 5} > > > Ah, understood. That's a pretty neat trick actually, might see if we can incorporate that somewhere.

Re: [sqlalchemy] Caching intermediate results in baked queries

2018-11-15 Thread Martijn van Oosterhout
ameters. The API for the user does resemble what you do with normally subclassing Query, which is nice because it means the users are getting baked queries, without actually knowing they're getting them. The saved parameters are automatically bound to the Result object on execution. Hope this is cl

Re: [sqlalchemy] Caching intermediate results in baked queries

2018-11-14 Thread Martijn van Oosterhout
ed. OTOH, it doesn't seem smart to try and to magic with tracebacks for something that shouldn't really happen in production code. I'm not sure what the state of the art is w.r.t. baked queries, but I hope this gives an idea of how we use it. Have a nice day, Martijn -- SQLAlchemy - T

Re: [sqlalchemy] Caching intermediate results in baked queries

2018-11-14 Thread Martijn van Oosterhout
into the construction of the query. However, if the QueryContext is the important part then it may not matter. We'll time it and see what happens. My question was mostly whether the "spoil but not spoil" approach might be a quickwin. Have a nice day, Martijn On Wed, 14 Nov 2018 at 14:54, Mike Ba

[sqlalchemy] Caching intermediate results in baked queries

2018-11-13 Thread Martijn van Oosterhout
mprovement? Thanks in advance, Martijn -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description. --- Yo

Re: [sqlalchemy] Baked queries vs before_execute hook

2017-10-12 Thread Martijn van Oosterhout
ewriting is more of a liability than I thought. Thanks for the help! Have a nice day, -- Martijn -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See

[sqlalchemy] Baked queries vs before_execute hook

2017-10-12 Thread Martijn van Oosterhout
Hi, Recently we've been looking into the baked query feature as a method of speeding up query compilation. We also use a before_execute hook to modify the query before execution to handle permission related stuff. One thing that turned up was that when using a baked query that it cached the

Re: [sqlalchemy] Combining yield_per and eager loading

2016-07-20 Thread Martijn van Oosterhout
in objs: yield obj -- Martijn -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post to this group,

Re: [sqlalchemy] Combining yield_per and eager loading

2016-07-20 Thread Martijn van Oosterhout
On 19 July 2016 at 23:22, Mike Bayer <mike...@zzzcomputing.com> wrote: > > > On 07/19/2016 05:20 PM, Martijn van Oosterhout wrote: > >> >> >> Thanks. On the way home though I had a thought: wouldn't it be simpler >> to run the original query with yiel

Re: [sqlalchemy] Combining yield_per and eager loading

2016-07-19 Thread Martijn van Oosterhout
On 19 July 2016 at 18:42, Mike Bayer <mike...@zzzcomputing.com> wrote: > > > On 07/19/2016 12:33 PM, Martijn van Oosterhout wrote: > >> On Sunday, July 17, 2016 at 8:47:11 AM UTC+2, Martijn van Oosterhout >> wrote: >> >> But in any ca

Re: [sqlalchemy] Combining yield_per and eager loading

2016-07-19 Thread Martijn van Oosterhout
On Sunday, July 17, 2016 at 8:47:11 AM UTC+2, Martijn van Oosterhout wrote: > > > I'll play a bit and see what I can get to work. Thanks again. > > So, I have a chance to play and got something that actually works quite nicely, see below. Two things: - I switched to referencing

Re: [sqlalchemy] Combining yield_per and eager loading

2016-07-17 Thread Martijn van Oosterhout
a bit and see what I can get to work. Thanks again. Martijn -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post t

Re: [sqlalchemy] Combining yield_per and eager loading

2016-07-15 Thread Martijn van Oosterhout
oks like it will work transparently with eager loading. It basically does the above, but skips the cursor and replaces it with queries on ranges of the primary key (which is shorter and probably more efficient to boot). Thanks for the tip! -- Martijn van Oosterhout <klep...@gmail.com> http

[sqlalchemy] Combining yield_per and eager loading

2016-07-15 Thread Martijn van Oosterhout
ewhere that might help? Thanks for any ideas, Have a nice day, -- Martijn van Oosterhout -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sql

[sqlalchemy] (Micro-)feature request: sessionmaker.configure(class_=foo)

2016-07-10 Thread Martijn van Oosterhout
and global, that leads to issues... It's not a really important feature, but it would allow us to clean up some warts here are there. Have a nice day, -- Martijn van Oosterhout -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubs

Re: [sqlalchemy] 1.1.0b1: construct has no default compilation handler.

2016-06-28 Thread Martijn van Oosterhout
On 28 June 2016 at 15:47, Mike Bayer <mike...@zzzcomputing.com> wrote: > > > On 06/28/2016 09:09 AM, Martijn van Oosterhout wrote: > >> >> That sqlite reference looks a bit weird, did I miss some initialisation >> somewhere? >> > > It looks like th

Re: [sqlalchemy] 1.1.0b1: construct has no default compilation handler.

2016-06-28 Thread Martijn van Oosterhout
ack trace at the very least. > > Good point. Attached. Just to get some more information I put stopped a debugger at the raise statement and got the following: > /home/martijn/virtualenv/eggs/SQLAlchemy-1.1.0b1-py2.7-linux-x86_64.egg/sqlalchemy/ext/compiler.py(459)__call__() -&

Re: [sqlalchemy] Re: Tracking query performance per Session

2016-06-27 Thread Martijn van Oosterhout
Ah, thanks for the tip, the info fields work nicely as well. Have a nice day, On Monday, June 27, 2016 at 4:09:54 PM UTC+2, Mike Bayer wrote: > > > Hi Martijn - > > Sorry I missed this post.Your solution is pretty good. For the > setattr() stuff, both Connection and Ses

[sqlalchemy] 1.1.0b1: construct has no default compilation handler.

2016-06-27 Thread Martijn van Oosterhout
this helps, -- Martijn van Oosterhout -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post to this group,

Re: [sqlalchemy] "RuntimeError: dictionary changed size during iteration" during configure_mappers

2016-06-27 Thread Martijn van Oosterhout
up that way in the beginning it can be painful to rework... -- Martijn van Oosterhout -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...

[sqlalchemy] Re: Tracking query performance per Session

2016-06-27 Thread Martijn van Oosterhout
On Tuesday, June 21, 2016 at 11:25:36 PM UTC+2, Martijn van Oosterhout wrote: > > Hi, > > In an effort to find the bottlenecks in our system we'd like to collect > statistics about which queries take a long time, or return a lot of rows, > or paths which are triggeri

[sqlalchemy] Tracking query performance per Session

2016-06-21 Thread Martijn van Oosterhout
to extract this information reliably? There is the after_begin() event on a Session which has both the Session and the Connection, but there doesn't appear to be a reliable moment when the Session is no longer related to a connection. Or am I missing something? Thanks in advance, -- Martijn van

[sqlalchemy] EXTRACT() not working as expected in PostgreSQL with TIMESTAMP WITH TIMEZONE

2013-06-04 Thread Martijn van Oosterhout
one. But is there a workaround to suppress the cast? Thanks in advance, -- Martijn van Oosterhout klep...@gmail.com -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To unsubscribe from this group and stop receiving emails from it, send an email

[sqlalchemy] Re: EXTRACT() not working as expected in PostgreSQL with TIMESTAMP WITH TIMEZONE

2013-06-04 Thread Martijn van Oosterhout
about all the builtin casts, but for now it's fine. Have a nice day, On Tuesday, June 4, 2013 10:53:22 AM UTC+2, Martijn van Oosterhout wrote: snip I think it's a bug and if people agree I can file one. But is there a workaround to suppress the cast? Thanks in advance, -- Martijn van

Re: [sqlalchemy] how to get into PG database, is the url the right way? newbie question

2012-08-17 Thread Martijn Moeling
I have made this for my project and I do not see why you are using Openlayers for this. This has nothing to do with sqlalchemy. off topic: Ext.form.Panel has no 'protocol' so I think you should extend FormPanel to include that functionality. Ext.direct is the way to go for stuff like this.

Re: [sqlalchemy] how to get into PG database, is the url the right way? newbie question

2012-08-17 Thread Martijn Moeling
since 4.x is so much better (consistant) , faster and more stable, I guess GeoExt is over a year behind reality. If you use that try if you can wait for GeoExt2 On Aug 18, 2012, at 02:24 , Martijn Moeling mart...@xs4us.nu wrote: I have made this for my project and I do not see why you are using

Re: [sqlalchemy] Id and id

2012-03-05 Thread Martijn Moeling
. and even more interesting, how to test for the name in the __init__ ? for some reason I do not seem to get no reference to name, even after calling Column.__init__, self.name == None, Am I thinking in the wrong direction? Martijn On Mar 5, 2012, at 00:06 , Michael Bayer wrote

Re: [sqlalchemy] Id and id

2012-03-05 Thread Martijn Moeling
from the class definition and put's 'id' in the json. the only change is 'JSid' in the definition and no extra overhead is added. This is nice since whilst solving this I found out that I have a few more of these (i.e. Name and name) Since I use PostgreSQL I got away with this…. Martijn On Mar 5

Re: [sqlalchemy] Id and id

2012-03-05 Thread Martijn Moeling
, at 6:52 AM, Martijn Moeling wrote: I think I've got it working correctly. in my mixin I now do: @declared_attr def id(self): return ExtColumn('JSid',Unicode(255), default = None) so the id property is actually stored in the DB Column 'JSid' Since my introspection

[sqlalchemy] Id and id

2012-03-04 Thread Martijn Moeling
a .lower() takes care of that. Can I switch it off if so? Martijn -- 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

Re: [sqlalchemy] Id and id

2012-03-04 Thread Martijn Moeling
Correction: SA version is 0.7.4 not 0.7.3 -- 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.

Re: [sqlalchemy] Extending sqlalchemy.schema.Column

2012-01-30 Thread Martijn Moeling
might overlook something, not sure… Martijn On Feb 28, 2011, at 18:21 , Michael Bayer wrote: Column can be subclassed but because they are intensively used in complex expression transformations, your custom class may be used in more scenarios than you first anticipate. There are two

Re: [sqlalchemy] Extending sqlalchemy.schema.Column

2012-01-30 Thread Martijn Moeling
Michael, Interesting stuff, The first part I had almost covered, I did not have the _constructor part. It wil be part of something more complex… Thankx, Martijn On Jan 30, 2012, at 17:46 , Michael Bayer wrote: On Jan 30, 2012, at 9:49 AM, Martijn Moeling wrote: sorry I have to get

Re: [sqlalchemy] Extending sqlalchemy.schema.Column

2012-01-30 Thread Martijn Moeling
, Michael Bayer wrote: On Jan 30, 2012, at 9:49 AM, Martijn Moeling wrote: sorry I have to get back on this. I renamed all Columns in my application definitions to MyColumn a while back. and everything worked. Now that I'm starting to use functionality of MyColumn. (The reason I needed

Re: [sqlalchemy] PG Sequence on non primary_key column and ForeignKey

2012-01-19 Thread Martijn Moeling
creation. I thought about specifying tables to see if that forces the creation order. Anyway it works now Martijn On Jan 18, 2012, at 21:14 , Martijn Moeling wrote: I managed to get PG (9.0) installed and I am in the process over moving over from MySQL, I allready have stuff working and am now

[sqlalchemy] Moving from Mysql to postgresql and Case Insensitive querys

2012-01-18 Thread Martijn Moeling
. Postgress supports (Since 8.4) the citext columntype. Is there any simple way of getting my queries to work in Case Insensitive mode Kind Regards, Martijn -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalchemy

Re: [sqlalchemy] joined table inheritance

2012-01-18 Thread Martijn Moeling
throw up a duplicate key error. This will help you out I think. Martijn On Jan 18, 2012, at 19:08 , Thierry wrote: Hi I'm trying to mimick the example from the documentation (employee/ manager/engineer) I've been able to add employees, and engineers, and all works as expected now my

[sqlalchemy] PG Sequence on non primary_key column and ForeignKey

2012-01-18 Thread Martijn Moeling
.SerialNumber') with a create_all I get this: (ProgrammingError) there is no unique constraint matching given keys for referenced table object1 I might be looking in the wrong direction here, the documentation only talks about Sequence with primary_key set to True Martijn -- You received

Re: Re: [sqlalchemy] joined table inheritance

2012-01-18 Thread Martijn Moeling
, value) In fact I have Overridden the SA Column and added my own parameters to generate javascript. Great it helped you Martijn On Jan 18, 2012, at 22:06 , Thierry wrote: Hi ! Thanks for the prompt, and very helpful answer I do now understand the logic a bit better I've been able to get

Re: [sqlalchemy] PG Sequence on non primary_key column and ForeignKey

2012-01-18 Thread Martijn Moeling
about that, it has to work the other way around too Thanks Martijn On Jan 18, 2012, at 22:39 , Conor wrote: On 01/18/2012 02:14 PM, Martijn Moeling wrote: I managed to get PG (9.0) installed and I am in the process over moving over from MySQL, I allready have stuff working and am now trying

Re: [sqlalchemy] Sequence on non primary_key and import data

2012-01-17 Thread Martijn Moeling
…. more work Thank you Michael! Martijn On Jan 17, 2012, at 02:29 , Michael Bayer wrote: On Jan 16, 2012, at 5:14 PM, Martijn Moeling wrote: I am planning on using PG for production but for now I'm stuck on Mysql. Mysql does not seem to support Sequence.. can't I just do x = Column

Re: [sqlalchemy] Sequence on non primary_key and import data

2012-01-16 Thread Martijn Moeling
Bump. On Jan 10, 2012, at 12:06 , Martijn Moeling wrote: Hi, I am running into something I am using MySQL but am moving to Postgress so I'm looking for something compatible with the two. I have to generate an unique number for each record created into a column separate from the Id

Re: [sqlalchemy] Sequence on non primary_key and import data

2012-01-16 Thread Martijn Moeling
, 2012, at 6:29 AM, Martijn Moeling wrote: Now I need to import data from the current production system. This data already has Serialnumbers generated. What should I do to make this work? Do I need the sequence created after the Import and set the Start value to the last imported SerialNumber

[sqlalchemy] Sequence on non primary_key and import data

2012-01-10 Thread Martijn Moeling
Order is a polymorphic base table and the sequence Column is in the polymorphic child tables only where Orders are in fact Items to be produced. The simplified version above is just to make things clear. Martijn -- You received this message because you are subscribed to the Google Groups

Re: [sqlalchemy] money type for Postgresql

2011-12-28 Thread Martijn Moeling
Type mentioned in this tread. Martijn On Dec 27, 2011, at 20:39 , dgardner wrote: Quick hack, figured I would share since there seemed to be other people asking about it. I couldn't get it to work with autoload=True for table reflection. --- from sqlalchemy import types from decimal

Re: [sqlalchemy] Querying number column as if it is a unicode column

2011-12-11 Thread Martijn Moeling
Kinda lame I could not find that I should have known Thanks! On Dec 9, 2011, at 16:01 , Michael Bayer wrote: On Dec 9, 2011, at 5:28 AM, Martijn Moeling wrote: Hi, I'm puzzled on how to get this working: class User(base): Id = Column (Integer

[sqlalchemy] Querying number column as if it is a unicode column

2011-12-09 Thread Martijn Moeling
() example data: 1, martijn 1 2, martijn 2 …. 100,martijn 100 searching for 1 will find all records with Id's - 1,11,12…., 19, 100 and records with a 1 somewhere in the name. there must be a way, right? Martijn -- You received this message because you

[sqlalchemy] weird error in import of sqla

2011-10-06 Thread Martijn Moeling
Hi, Something rendered my sqlalchemy on OSX lion unusable Traceback (most recent call last): File /Users/martijn/Documents/workspace/UCO/src/ConvertData.py, line 9, in module from sqlalchemy import * File /Library/Python/2.7/site-packages/SQLAlchemy-0.7.2-py2.7-macosx-10.7-intel.egg

Re: [sqlalchemy] weird error in import of sqla

2011-10-06 Thread Martijn Moeling
Never mind… I still had library definitions in eclipse set to python 2.6…. Thanks for reading Martijn On Oct 6, 2011, at 13:02 , Martijn Moeling wrote: Hi, Something rendered my sqlalchemy on OSX lion unusable Traceback (most recent call last): File /Users/martijn/Documents

[sqlalchemy] Best practice for changing record structure

2011-09-06 Thread Martijn Moeling
… Martijn -- 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

Re: [sqlalchemy] Best practice for changing record structure

2011-09-06 Thread Martijn Moeling
extjs which I use for my project. I'll be in touch! Martijn On Sep 6, 2011, at 16:09 , Michael Bayer wrote: On Sep 6, 2011, at 9:38 AM, Martijn Moeling wrote: Hi! As a big fan of SQLA I am looking for a way to implement something which would in fact be something like phpmysqladmin

Re: [sqlalchemy] SQLAlchemy 0.7.2 Released

2011-08-02 Thread Martijn Moeling
Thank you for all the effort you put in. SQLAlchemy has been a proven tool for me and as it seems for many others. On Aug 1, 2011, at 02:17 , Michael Bayer wrote: SQLAlchemy version 0.7.2 is now available. A lot has been going on leading up to this release, and there was actually a

[sqlalchemy] [0.7.1] Building C extentions fail on installing for OS X

2011-06-24 Thread Martijn
to remove -arch ppc from the gcc options I am up to date with both OS X and Xcode and it seems universal binary related... I have searched the list but could not find anything related Martijn -- You received this message because you are subscribed to the Google Groups sqlalchemy group

Re: [sqlalchemy] [0.7.1] Building C extentions fail on installing for OS X

2011-06-24 Thread Martijn
2011 18:50, Martijn mart...@xs4us.nu wrote: When installing on OSX the install log shows: building 'sqlalchemy.cprocessors' extension gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch ppc -arch x86_64 -pipe -I

Re: [sqlalchemy] Re: Extending sqlalchemy.schema.Column and metaprogramming traps

2011-02-28 Thread Martijn Moeling
): do_something_not_sa_related validation = 'someregex' and use MyColumn in places where I normally use Column(..) What do I need to take into account, I've done some tests and Error hell broke loose, where the errors are hidden deep inside SA so hard to overcome. Martijn On Dec

Re: [sqlalchemy] Re: Extending sqlalchemy.schema.Column and metaprogramming traps

2011-02-28 Thread Martijn Moeling
is all you need. On Feb 28, 2011, at 10:17 AM, Martijn Moeling wrote: Hi, I know this is an OLD threat but I was searching the group to see If I was not the first one doing this. I am not sure I understand very well what this threat is all about, but I want to extend the Column

[sqlalchemy] UTC DateTimes

2011-02-19 Thread Martijn Moeling
that DateTime and Time values are stored as UTC in the database automatically. The front end code will display the local time as it will consider all values from the database as UTC. Martijn -- You received this message because you are subscribed to the Google Groups sqlalchemy group

Re: [sqlalchemy] UTC DateTimes

2011-02-19 Thread Martijn Moeling
Cool that is what I thought, On Feb 19, 2011, at 17:32 , Michael Bayer wrote: On Feb 19, 2011, at 6:40 AM, Martijn Moeling wrote: Hi, I would like to store all time values in my database as UTC values (automatically). I already have the proper conversion routines in my own CALDAV

[sqlalchemy] Polymorhic tables and __table__.columns

2011-02-19 Thread Martijn Moeling
' talk about the Id but in my real world there are more Columns in BaseClass Martijn -- 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

Re: [sqlalchemy] Re: Dynamic relations...

2011-02-16 Thread Martijn Moeling
a BIG THANK YOU for all your help Martijn On Feb 14, 2011, at 14:04 , Martijn Moeling wrote: Eric (and Michael), Thank you for your comments, I agree with you totally. I am not much of a database guy and never have been. During my education I did not pay much attention to those lessons

Re: [sqlalchemy] Re: Dynamic relations...

2011-02-14 Thread Martijn Moeling
suppose it's partly because they would be so much more difficult to handle, or even come close to handling, conveniently, with most other ORM packages. Martijn, after running into the wall on polymorphic associations approximately once a year since Michael wrote that blog article, I finally

Re: [sqlalchemy] Re: Dynamic relations... !!

2011-02-14 Thread Martijn Moeling
not seem to be relevant. Martijn On Feb 14, 2011, at 14:04 , Martijn Moeling wrote: Eric (and Michael), Thank you for your comments, I agree with you totally. I am not much of a database guy and never have been. During my education I did not pay much attention to those lessons either

Re: [sqlalchemy] Dynamic relations...

2011-02-13 Thread Martijn Moeling
#3, discriminator ext2 - how can more than one Extra row be referenced? Why is extras assumed to be one-to-many when it can only be many-to-one ? On Feb 12, 2011, at 9:57 AM, Martijn Moeling wrote: This whole thing is driving me crazy, What I want: class Extra(Base

Re: [sqlalchemy] Dynamic relations...

2011-02-13 Thread Martijn Moeling
. Your solution is definitively one I could not have put together myself. Although I have tried. SQLAlchemy is so powerful that it is hard to find the right options for the job. Thank you again! Martijn On Feb 13, 2011, at 21:19 , Michael Bayer wrote: On Feb 13, 2011, at 6:14 AM, Martijn Moeling

Re: [sqlalchemy] Dynamic relations...

2011-02-12 Thread Martijn Moeling
really need the @declared_attr way of doing stuff and that is not related to this question but might influence this question so I left it in.. Martijn On Feb 10, 2011, at 18:13 , Michael Bayer wrote: On Feb 10, 2011, at 4:20 AM, Martijn Moeling wrote: Another small thing: I took

Re: [sqlalchemy] Dynamic relations...

2011-02-12 Thread Martijn Moeling
with or without a discriminator column. A single class can't be mapped in both ways.If there's no discriminator, there's just one class that can be used for returned rows. Martijn On Feb 12, 2011, at 15:57 , Martijn Moeling wrote: This whole thing is driving me crazy, What I want

[sqlalchemy] Dynamic relations...

2011-02-10 Thread Martijn Moeling
: . Martijn -- 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

Re: [sqlalchemy] MapperExtension.append_result ....

2011-02-08 Thread Martijn Moeling
Martijn On Feb 7, 2011, at 5:55 PM, Michael Bayer wrote: On Feb 7, 2011, at 11:42 AM, Martijn Moeling wrote: I think, I might be helped with the create_instance event Assuming you're talking about when the ORM establishes an instance from a newly fetched row, you can use

Re: [sqlalchemy] MapperExtension.append_result ....

2011-02-08 Thread Martijn Moeling
to their needs. I find that the deeper I dive into SA, the less examples are available, the harder it is to test functionality and sometimes documentation gets more sparse. Thank you again... Martijn On Feb 8, 2011, at 4:21 PM, Michael Bayer wrote: On Feb 8, 2011, at 6:05 AM, Martijn

[sqlalchemy] Declarative, Imports and Base

2011-02-08 Thread Martijn Moeling
are together in a package and d is imported with similar packages into something bigger Martijn -- 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

Re: [sqlalchemy] Declarative, Imports and Base

2011-02-08 Thread Martijn Moeling
without a Base at all so there is no Issue Am I right? in understanding your comments on my first mail in this topic? Martijn On Feb 8, 2011, at 7:46 PM, Michael Bayer wrote: On Feb 8, 2011, at 1:19 PM, Martijn Moeling wrote: Hi, I am having a small issue with multiple python

Re: [sqlalchemy] Declarative, Imports and Base

2011-02-08 Thread Martijn Moeling
, Martijn Moeling wrote: Michael, Do you ever sleep? I am not sure I get your point. How do I set up a common Base. I could do Base= Declarative_base() from a import A (or * not sure how this differs in this case) from b import B (or *) If I do not declare Base in module a I get

Re: [sqlalchemy] Declarative, Imports and Base

2011-02-08 Thread Martijn Moeling
Clear! On Feb 8, 2011, at 10:21 PM, Michael Bayer wrote: On Feb 8, 2011, at 3:57 PM, Martijn Moeling wrote: Clear, if all packages are in the same project that is.. and what if in a.py I want to inherit some class mapped with b.py mixin does not allways work as a solution

[sqlalchemy] MapperExtension.append_result ....

2011-02-07 Thread Martijn Moeling
this long code (a lot of different object types pass through here, remember the polymorhic bit) Does anyone have an interesting approach to this? basically I need to do something like instance= instance_class_type(new, configuration, based, on, the, ACL) Any help would be wonderfull, Martijn

Re: [sqlalchemy] MapperExtension.append_result ....

2011-02-07 Thread Martijn Moeling
the molecule stuff makes it even more confusing.. Will take me some time though Martijn On Feb 7, 2011, at 5:18 PM, Michael Bayer wrote: On Feb 7, 2011, at 10:55 AM, Martijn Moeling wrote: Hi, It is me again with an interesting thing, I've searched the net, this group etc. Not a lot

Re: [sqlalchemy] nested Polymorphic tables..

2011-02-01 Thread Martijn Moeling
but the last one seems more elegant for future use Martijn On Jan 31, 2011, at 7:40 PM, Michael Bayer wrote: here we are, I was just doing it wrong. This approach is pure declarative, then sets up specialized polymorphic attributes on Address, PostalAddress after the fact

[sqlalchemy] nested Polymorphic tables..

2011-01-31 Thread Martijn Moeling
is possible) Again this is a fake data model to make my point Any suggestions? Martijn -- 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

UPDATE PLS HELP [sqlalchemy] Define a relation table

2011-01-04 Thread Martijn Moeling
this right from the beginning helps me a lot. The definition of Affiliation, Person and Company can be found below. Martijn On Jan 4, 2011, at 9:55 AM, Martijn Moeling wrote: Hi I have done the following: class Affiliation(Base): __tablename__ = affiliations Id

Re: UPDATE PLS HELP [sqlalchemy] Define a relation table

2011-01-04 Thread Martijn Moeling
you Again for your great help. I'm Not really good in Database stuff, but did/do a lot on the mod_python/mod_wsgi lists so I know about the huge amounts of time spent Martijn On Jan 4, 2011, at 7:20 PM, Michael Bayer wrote: from sqlalchemy import * from sqlalchemy.orm import * from

Re: [sqlalchemy] Create_all() - Create_JustThese(engine, [Table1,Table2,....])?

2010-10-29 Thread Martijn Moeling
Simon (and the others), thank you! the someClass.__table__works... Kind regards, Martijn On Oct 27, 2010, at 5:02 PM, King Simon-NFHD78 wrote: -Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Martijn Moeling Sent: 27

Re: [sqlalchemy] Working with mapper objects without saving them

2010-10-29 Thread Martijn Moeling
for handling data without saving it to a database. SQLAlchemy works fine when no database connection is present Martijn On Oct 27, 2010, at 5:41 PM, Michael Bayer wrote: On Oct 27, 2010, at 11:31 AM, Michael Elsdörfer wrote: I have a mapper-based data model that uses relationships

[sqlalchemy] Create_all() - Create_JustThese(engine, [Table1,Table2,....])?

2010-10-27 Thread Martijn Moeling
want this, I just want to know if it is possible and it would help me out big time if it is Martijn -- 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] create_all() trows table already exist, is not there and is not created....

2010-04-12 Thread Martijn Moeling
' () even though the table is not there!, Only the Calendars table is created Any suggestions? Martijn -- 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] Declerative Relation trouble

2009-10-15 Thread Martijn Moeling
) So what I need is help with the relation and Foreign Key columns including the backrefs (I need to search CalendarEvents and find the corresponding Calendar) Thank you very mutch Martijn --~--~-~--~~~---~--~~ You received this message because you

[sqlalchemy] Re: Declerative Relation trouble

2009-10-15 Thread Martijn Moeling
not find table 'Calendar' with which to generate a foreign key which is excacly the same as I got. I have done so mutch in python/sqlalchemy that I feel extremely stupid not to get this working, it might be just a case of overreading the problem Martijn On Oct 15, 2009, at 4:10 PM, King

[sqlalchemy] Re: Declerative Relation trouble

2009-10-15 Thread Martijn Moeling
I downgraded SQLA to version 0.5.5, no luck, (Simon) what version of python are you using? On Oct 15, 2009, at 4:45 PM, Martijn Moeling wrote: Hi Simon/all, When I run your example i get: Traceback (most recent call last): File /var/www/PyWebOs/caltst.py, line 41, in module cal

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

2009-10-15 Thread Martijn Moeling
(Mod_python) so is there anything I can try? (Database changes give me the same results on both mysql and sqllite so that seems no problem) Martijn On Oct 15, 2009, at 4:59 PM, King Simon-NFHD78 wrote: -Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com

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

2009-10-15 Thread Martijn Moeling
Mod_python has nothing to do with this project, so I run it from idle within X On Oct 15, 2009, at 5:23 PM, King Simon-NFHD78 wrote: -Original Message- From: sqlalchemy@googlegroups.com [mailto:sqlalch...@googlegroups.com] On Behalf Of Martijn Moeling Sent: 15 October 2009 16:21

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

2009-10-15 Thread Martijn Moeling
) I'll keep you posted! Martijn On Oct 15, 2009, at 5:33 PM, King Simon-NFHD78 wrote: -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

[sqlalchemy] Do not use the idle -n command when using SQLA

2009-10-15 Thread Martijn Moeling
So To complete Simons suggestion about idle, Do not use the -n switch on idle when playing with SQLAlchemy. On Oct 15, 2009, at 6:55 PM, Martijn Moeling wrote: (in the mean time I drove home. dinner soon) Indeed, running it from command line changes things, Strange

[sqlalchemy] Create Table errors on mysql...

2009-10-14 Thread Martijn Moeling
with BackQuotes (`). I am puzzled what to do to fix this. Please help, Martijn --~--~-~--~~~---~--~~ 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: Create Table errors on mysql...

2009-10-14 Thread Martijn Moeling
Thanks Guy's! Kinda stupid, but that happens with the use of examples. Martijn On Oct 14, 2009, at 3:34 PM, limodou wrote: On Wed, Oct 14, 2009 at 9:03 PM, Martijn Moeling mart...@xs4us.nu wrote: Hi, I have a python module where I am implementing several classes. When I do

[sqlalchemy] Re: relations with additional criteria

2009-10-08 Thread Martijn Faassen
bring it up to see whether there was a better way. And then we got into a bit of a discussion. :) Regards, Martijn --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email

[sqlalchemy] Re: relations with additional criteria

2009-10-08 Thread Martijn Faassen
, assuming autoflush is turned on. SQLAlchemy's behavior of caching collections in the first place is fairly unique among Python ORMs (its more of a Hibernate thing) so this is the usual way that issue is addressed. Thanks for the tip! Regards, Martijn

[sqlalchemy] Re: relations with additional criteria

2009-10-06 Thread Martijn Faassen
be determined. In order to handle all these cases I think in my subclass I'd need to handle them too. In addition I'm curious what _orm_deannotate does and why deannotating the extra clause isn't needed in this case. Regards, Martijn --~--~-~--~~~---~--~~ You received

[sqlalchemy] Re: relations with additional criteria

2009-10-05 Thread Martijn Faassen
Hey, Michael Bayer wrote: Martijn Faassen wrote: Michael Bayer wrote: subclass RelationProperty fine, but don't get involved with overriding its internal _xxx methods. So: Override do_init() completely (not calling the super do_init()). no, call do_init(). def do_init(self

[sqlalchemy] Re: relations with additional criteria

2009-10-01 Thread Martijn Faassen
'), }) How in the implementation of my_own_relation am I to find out about B? I think this is only possible to do when do_init() is called on the relation property. Regards, Martijn --~--~-~--~~~---~--~~ You received this message because you

[sqlalchemy] Re: relations with additional criteria

2009-10-01 Thread Martijn Faassen
just want to add a custom condition to the automatically set up primary... Regards, Martijn --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalchemy

[sqlalchemy] relations with additional criteria

2009-09-29 Thread Martijn Faassen
it is, and that's not so common. I imagine an optional callable that takes the parent and child tables as arguments and can return a custom filter expression on them. I haven't thought through how this works with many to many relationships yet though. Regards, Martijn

[sqlalchemy] Re: relations with additional criteria

2009-09-29 Thread Martijn Faassen
) This presents a potential alternative implementation strategy where this is implemented using properties on the model classes that do something like this. Regards, Martijn --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

  1   2   >