mmmh.
This is about underlying base-framework of a system, equivalent in
complexity to ERP.
So i have unknown hierarchy of classes - be them documents, entities,
whatever u fancy. And they can point to each other in an unknown way.
if u want some example: DocumentA1 has some data and
the above query you are issuing straight textual SQL. SA has no clue
what types to return and it has no say in it - the inconsistent
behavior above originates within your database/DBAPI (which you havent
told me which one it is).
I'm using Mysql5
A very simple table that give me problems:
On 1/17/07, Antonio [EMAIL PROTECTED] wrote:
and now, how can I retrieve the file (res.pdf.data) in a file or send it
as output in a html page (sendig the right headers) ?
Nothing magical:
file('foo.pdf', 'wb').write(res.pdf.data)
see your html framework's docs for instructions on sending
Oops, I didn't notice at first that you are using pg_largeobject...
That's not a good idea, you should really use bytea (for SA, that
means declaring filepdf as a Binary column itself rather than linking
to pg_largeobject) unless you are planning to manually seek inside the
lo (i.e. with
svil wrote:
P.S. u can remove the other repeating post from another account fo mine
- seems GG has weird latenicies, hence i double posted... and first one
appeared 10hrs later than second.
its because google marked them all as spam. seeing as there were 5
duplicate messages, i let one
On Wed, 2007-01-17 at 11:45 +0100, Antonio wrote:
Hi all,
I'm trying to read a pdf file saved in a postgresql table :
and now, how can I retrieve the file (res.pdf.data) in a file or send it
as output in a html page (sendig the right headers) ?
Antonio,
I did a very similar thing (storing
if you want the behavior to happen within SA itself in a transparent
way, youd have to provide redefined versions of sqlite.SLDialect and
mysql.MSDialect and friends which add these behaviors in. but
personally I wouldnt want to insert those behaviors into SA itself. id
rather write an app
without seeing a full example, its looking like a mysql bug. SA's
datetime implementation for MySQL doesnt do any conversion from return
value since MySQLDB handles that task. whereas the sqlite dialect in
SA *does* do conversion since sqlite doesnt handle that.
svil wrote:
So i have unknown hierarchy of classes - be them documents, entities,
whatever u fancy. And they can point to each other in an unknown way.
so, you are looking to create an application that generates python
applications, basically. if you want to use SA for that, you have to
So i have unknown hierarchy of classes - be them documents, entities,
whatever u fancy. And they can point to each other in an unknown way.
so, you are looking to create an application that generates python
applications, basically.
hm, can be interpreted this way. just add 'and interpret
I seem to have stumbled upon a bug, but perhaps I'm just using
MapperExtension wrong. Anyway, here's some code that doesn't work:
---
from sqlalchemy import *
from sqlalchemy.orm import MapperExtension
global_session = create_session()
metadata = BoundMetaData('mysql://[EMAIL
svil wrote:
is it errorneus to explicitly put the (correct) joins even if they
could be figured out by SA?
its not. but made your code that much harder to read (there was a lot
more that made it even harder, thats just one cherry-picked example).
Two examples are the StaticType declarative
its python and its unfortunate typing error behaviorextension
needs to be an instance:
testmapper = mapper(Test, test_table, extension=ModifiedMapper())
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
is it errorneus to explicitly put the (correct) joins even if they
could be figured out by SA?
its not. but made your code that much harder to read
well, this case does require them :-(
which has a way to interpret python functions into Expr-trees, which
then can be translated (read
On Jan 17, 2007, at 5:09 PM, svil wrote:
110. can't make it less ;-)
can?
and it is about A=Employee and B=Manager, and all Employees having a
manager.
http://linuxteam.sistechnology.com/orm/sa_B_inh_A_A_ref_AB2.py
OK. the first attachment called test_case1.py is how I'd like you
to send
yeah im trying to keep SA as simple as possible, and whatever hooks and
extensions I put in are because they are absolutely needed (like the
various MapperExtension hooks are allowing you to put code in the
middle of existing processes, i.e. template methods). for extending
Session, current
I finally came back to this. Here's what I ended up with:
# I tried to enable profiling on a per-engine level before resorting to this
# hack. (Monkey-patching classes by scanning the gc! Woot!)
#
# Per-engine profile turns out to totally not work because there's so many
# layers of clever
Thinking about it more, I should probably just override the methods of
Connection itself and not worry about subclasses. If someone is
overriding _execute*, he can do his own damn profiling. :)
On 1/17/07, Jonathan Ellis [EMAIL PROTECTED] wrote:
I finally came back to this. Here's what I
18 matches
Mail list logo