Hi Mauricio, Werner, Michael,
Thank you for your replies. I understand storing the files in file system
might be an easier option, but that would be my last option. If I can make
it work with the database, I've got good reasons to go with it.
I'm not trying to store an exisitng physical file
On Tue, Feb 26, 2013 at 2:44 PM, dalia dalia@gmail.com wrote:
Hi,
My intention is - to store .xls, .doc and .pdf files (with images in them)
to store in a Oracle database and retrieve them. I'm using SQLAlchemy
declarative code. The problem is, the data gets stored in the database but
Thanks a lot Simon. I am using Pylons, but response.body actually worked. I
can get my xls file alright now.
Thanks for all your help!
On Wednesday, February 27, 2013 11:40:22 AM UTC, Simon King wrote:
On Tue, Feb 26, 2013 at 2:44 PM, dalia dali...@gmail.com javascript:
wrote:
Hi,
Hello.
Suppose I have the following mapped classes, A and B, that have two distinct M:N
relationships, AB1 and AB2. If A.x is null, only relations in AB1 apply. If it
is not null, only relations in AB2 apply. A also has 1:N relationship to C (one
A can have more Cs). Finally, A is infact a joined
I'm not yet digging into your problem, but one remark would be that there's two
levels to deal with here. One is figuring out exactly what SQL you want,
independent of SQLAlchemy. It's not clear here if you've gotten that part yet.
The next part is getting parts of that SQL to route into your
On Feb 27, 2013, at 12:21 PM, Ladislav Lenart lenart...@volny.cz wrote:
Hello.
Suppose I have the following mapped classes, A and B, that have two distinct
M:N
relationships, AB1 and AB2. If A.x is null, only relations in AB1 apply. If it
is not null, only relations in AB2 apply. A also
Sure! Here's the query I am attempting to replicate:
SELECT people.id AS person_id, people.name, towns.id AS town_id, towns.name
FROM people
INNER JOIN visited_destinations ON visited_destinations.person_id =
people.id
INNER JOIN towns ON towns.id = visited_destinations.town_id
WHERE towns.name
oh. I saw you talking about at least one and exists and thought you had a
more complex query.contains_eager() doesn't impact what's queried, only how
results are used with the resulting objects, and is usually used with join(),
just like this:
session.query(Person).\
Ah okay, so you do recommend the contains_eager approach. I guess this is
exactly the use-case it is designed for? I always get a little scared when
I try using advanced features of SQLAlchemy :)
One last question. The query here seems to take advantage of the fact that
our table joins on
On Feb 27, 2013, at 2:40 PM, Rob Crowell rob.crow...@moat.com wrote:
Ah okay, so you do recommend the contains_eager approach. I guess this is
exactly the use-case it is designed for? I always get a little scared when I
try using advanced features of SQLAlchemy :)
One last question.
Hello.
Thank you for your prompt answer. I will try to create a working example that
demonstrates the issue. Though it will take me a couple of days, maybe weeks (my
regular work followed by a vacation).
I have another problem. I rephrased the SQL, because postgres's planner had
issues with
On Feb 27, 2013, at 3:12 PM, Ladislav Lenart lenart...@volny.cz wrote:
Hello.
Thank you for your prompt answer. I will try to create a working example that
demonstrates the issue. Though it will take me a couple of days, maybe weeks
(my
regular work followed by a vacation).
I have
Oh cool! I was getting incorrect results putting VisitedDestinations.town
in my contains_eager() call as you suggested, maybe I am doing something
wrong:
session = Session()
visited_alias = aliased(Town)
wishlist_alias = aliased(Town)
q = session.query(Person)
q =
Python 2.7.3 (default, Jan 4 2013, 14:06:23)
[GCC 4.2.1 Compatible Apple Clang 4.1 ((tags/Apple/clang-421.11.66))] on
darwin
Type help, copyright, credits or license for more information.
import sqlalchemy
print sqlalchemy.__version__
0.8.0b2
Below is the code I was able to use to reproduce a
AbstractConcreteAbstraction doesn't know that it's mapped until other mappers
configure themselves. In the absence of such an event,
call sqlalchemy.orm.configure_mappers() when all subclasses of
AbstractConcreteAbstraction have been declared to force this process to occur.
On Feb 27, 2013,
Thanks again Michael.
A note in the
http://docs.sqlalchemy.org/en/rel_0_8/orm/extensions/declarative.html#using-the-concrete-helpers
section would be great!
On Wednesday, February 27, 2013 6:25:24 PM UTC-6, Michael Bayer wrote:
AbstractConcreteAbstraction doesn't know that it's mapped until
Having fun with AbstractBaseClasses tonight :) ... Anyways am I missing
something here as well?
I tried playing with querying the AbstractBaseClass and filtering on sub
classes but that just produced
a query that did not execute.
from sqlalchemy.engine import Engine
from sqlalchemy import
just features that weren't anticipated (I never use concrete inheritance).
here's what will work for now.
class AbstractConcreteAbstraction(AbstractConcreteBase, sqlite):
__table_args__ = (UniqueConstraint('derpa',
'derp'),)
id = Column(Integer, primary_key=True)
derpa =
simpler, just stick the relationship on ACA:
session = Session(engine)
print session.query(ConcreteConcreteAbstraction).filter(
ConcreteConcreteAbstraction.something.has(id=1)).all()
AbstractConcreteAbstraction.something = relationship(Something)
print
OK, I've reconstructed mappings which correspond directly to your Query as
given, and it produces the identical SQL. I've inserted a bunch of rows into
all the tables so that a polymorphic result comes back, so that we can in fact
verify that the ORM reads the client_id column correctly.
Your
20 matches
Mail list logo