[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] Display SQL of create table

2008-07-09 Thread Hermann Himmelbauer
Hi, Is there a simple way to display the create statements of SA Tables? If I do a my_table.create(), some SQL is created and executed, is there a way to find retrieve this as a string without creating the table? Best Regards, Hermann -- [EMAIL PROTECTED] GPG key ID: 299893C7 (on keyservers)

[sqlalchemy] Re: Display SQL of create table

2008-07-09 Thread Michael Bayer
theres a recipe for this here: http://www.sqlalchemy.org/trac/wiki/FAQ#HowcanIgettheCREATETABLEDROPTABLEoutputasastring On Jul 9, 2008, at 8:45 AM, Hermann Himmelbauer wrote: Hi, Is there a simple way to display the create statements of SA Tables? If I do a my_table.create(), some SQL

[sqlalchemy] sAsync in complex project

2008-07-09 Thread zipito
Good day community. I don't know whether it is a good place to asc. I've used sqlalchemy with turbogears and there were no problems. Easy and strateforward. I've got lots of tables with lots of TableClasses where I implement application logic. Now I'm trying to use sqlalchemy with twisted. So

[sqlalchemy] Re: Mapped class and c attribute in 0.5

2008-07-09 Thread Luis Bruno
Michael Bayer escreveu: in 0.5, the attributes on classes vs. the columns on Tables are very different beasts now. Got bitten by this too; I'm using MappedClass.c.keys() to serialize all attributes of a class but don't want to write out every field name. Should I use

[sqlalchemy] Re: integrating SQLAlchemy in a WSGI based framework

2008-07-09 Thread Manlio Perillo
Michael Bayer ha scritto: On Jul 8, 2008, at 2:50 PM, Manlio Perillo wrote: Michael Bayer ha scritto: [...] Current integration approaches focus on the scoped_session() construct as home base for the current transaction. Ah, sorry. Sessions are not a problem, since the common

[sqlalchemy] Printing the SQL generated by table.create()

2008-07-09 Thread Aaron Torres
Hey all, I've been looking through the documentation and searching google for answers to this, but I can't seem to find a solution. if I set meta.bind.echo=True, I can see the SQL statement that is being generated when I call table.create(). Is there any way I can easily grab this sql statement

[sqlalchemy] Re: sAsync in complex project

2008-07-09 Thread Michael Bayer
On Jul 9, 2008, at 11:59 AM, zipito wrote: Good day community. I don't know whether it is a good place to asc. I've used sqlalchemy with turbogears and there were no problems. Easy and strateforward. I've got lots of tables with lots of TableClasses where I implement application logic.

[sqlalchemy] Re: Mapped class and c attribute in 0.5

2008-07-09 Thread Michael Bayer
On Jul 9, 2008, at 12:10 PM, Luis Bruno wrote: Michael Bayer escreveu: in 0.5, the attributes on classes vs. the columns on Tables are very different beasts now. Got bitten by this too; I'm using MappedClass.c.keys() to serialize all attributes of a class but don't want to write out

[sqlalchemy] Re: Printing the SQL generated by table.create()

2008-07-09 Thread jason kirtland
Aaron Torres wrote: Hey all, I've been looking through the documentation and searching google for answers to this, but I can't seem to find a solution. if I set meta.bind.echo=True, I can see the SQL statement that is being generated when I call table.create(). Is there any way I can

[sqlalchemy] Re: Printing the SQL generated by table.create()

2008-07-09 Thread Michael Bayer
On Jul 9, 2008, at 1:09 PM, Aaron Torres wrote: Hey all, I've been looking through the documentation and searching google for answers to this, but I can't seem to find a solution. if I set meta.bind.echo=True, I can see the SQL statement that is being generated when I call

[sqlalchemy] Re: Printing the SQL generated by table.create()

2008-07-09 Thread Aaron Torres
Ah my apologies, Apparently the search terms I was using to find an answer weren't what I needed! In any case, thanks a lot! This is a real life saver. On Jul 9, 11:13 am, Michael Bayer [EMAIL PROTECTED] wrote: On Jul 9, 2008, at 1:09 PM, Aaron Torres wrote: Hey all, I've been

[sqlalchemy] circular model definitions

2008-07-09 Thread Matt Haggard
I'm stumped... Setup: (Problem statement near the bottom) In my Pylons app, I have three separate models: Customer, TPPAnswer, SAQ TPPAnswer is many-to-one Customer SAQ is many-to-one Customer Both have backreferences (so saq.customer and customer.saqs) Currently, I have them defined in

[sqlalchemy] Re: Mapped class and c attribute in 0.5

2008-07-09 Thread Luis Bruno
Michael Bayer escreveu: Luis Bruno wrote: items = dict() for field in self._sa_class_manager.keys(): items[field] = getattr(self, field) Is there a simpler way, perhaps? obj.__dict__ is available as always for reading, I'd think thats the easiest way to get at current object

[sqlalchemy] Re: circular model definitions

2008-07-09 Thread Michael Bayer
On Jul 9, 2008, at 1:25 PM, Matt Haggard wrote: How do I set up my model such that I can import the pieces I need when I need them? So if I call a certain method of the customer object (adjust_grade() for example) it will be able to acquire all the attributes it needs. I don't want to

[sqlalchemy] Re: relation with same class/table on both sides

2008-07-09 Thread Tom Hogarty
The manager and direct reports example was just what my project needed. I'm looking forward to upgrading to 0.5 in the future so that I don't have to enter redundant primaryjoin and secondaryjoin on the backref. Thank you Mike! On Jun 28, 1:10 am, Tom Hogarty [EMAIL PROTECTED] wrote: Wow,

[sqlalchemy] do not load large binary column but make available on demand

2008-07-09 Thread Tom Hogarty
Hello, I have a table that stores binary file data in one column and information about the file (file name, mime type, sha1 sum, etc) in the other columns. Currently when I use the mapped class, it loads the file data (adds to network and memory load). What I would like to do is check the sha1

[sqlalchemy] Re: do not load large binary column but make available on demand

2008-07-09 Thread Rick Morrison
Sounds like you want deferred loading for the column: http://www.sqlalchemy.org/docs/04/mappers.html#advdatamapping_mapper_deferred --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this

[sqlalchemy] Re: do not load large binary column but make available on demand

2008-07-09 Thread Tom Hogarty
Deferred column loading is exactly what I needed, thanks Rick! Coming from a pure SQL background I'm starting to get familiar with all this new ORM and SQLAlchemy terminology. It's worth it though, the code is so much cleaner and more maintainable than stringing together huge complicated SQL

[sqlalchemy] Re: do not load large binary column but make available on demand

2008-07-09 Thread Rick Morrison
I started off with using only the SQL-API part of SA myself, but the ORM is way too good to ignore, and I've since converted piles of code over to using the ORM, typically with a 50% loss in lines of code and while getting much better code reuse. The query as a mapper-aware select orientation of