this is my code . my question is how can i check out the data from my db.
i have try query=session.query(Friend)
but i think that might be wrong
so..what place i have to add the code query=seesion.query(frined)???
p.s. i just the rookie
this is my database
id | name
I'm not sure I understand your application. Are you saying that you
have Person instances that stay in memory for longer than a single web
request?
Simon
On Sun, Jun 29, 2014 at 11:54 AM, Bao Niu niuba...@gmail.com wrote:
Hi Mike,
Thanks for your reply. In my case, the full_name attribute is a
Hi Simon,
Sorry for the poor explanation in my previous post.
Let me try to clarify this using a flow here:
---
1st_web_request comes in to tell the server which person instances are to
be interested. because it involves
What you are suggesting is definitely not what I think of as the
traditional pattern for a web application (but I don't know exactly
what you are trying to do, so perhaps you have good reasons for doing
things this way).
In the web applications that I write, there is no real state on the
server
Thanks Simon. I think my train of thought isn't quite clear at this point.
Sorry for this, I appreciate your comment and you are right I think I need
to work on my understanding of two different session concept, it's a bit
complex.
On Jun 30, 2014 4:12 AM, Simon King si...@simonking.org.uk wrote:
Consider the following configuration:
class Employee(Base):
__tablename__ = employee
id = Column(Integer, primary_key=True)
type = Column(String(100))
cars = relationship(Car)
__mapper_args__ = {
polymorphic_on: type,
}
class Car(Base):
__tablename__
Using postgresql, I have a JSON type column. My understanding from their
docs was that only jsonb columns could have an index created on them (a
feature of postgresql 9.4) but then I found an SO answer
http://stackoverflow.com/questions/17807030/how-to-create-index-on-json-field-in-postgres-9-3
On 6/30/14, 6:01 PM, univerio wrote:
Consider the following configuration:
class Employee(Base):
__tablename__ = employee
id = Column(Integer, primary_key=True)
type = Column(String(100))
cars = relationship(Car)
__mapper_args__ = {
On 6/30/14, 7:03 PM, Mike Bayer wrote:
there's a little bit of a glitch here, however in any case, the ORDER
BY would be from E.Engineer.specialty.
The glitch is that the subq load at the moment seems to need an
additional hint as to what its selecting from:
Thanks for the quick response, Mike!
On Mon, Jun 30, 2014 at 4:26 PM, Mike Bayer mike...@zzzcomputing.com
wrote:
On 6/30/14, 7:03 PM, Mike Bayer wrote:
there's a little bit of a glitch here, however in any case, the ORDER BY
would be from E.Engineer.specialty.
The glitch is that the
On 6/30/14, 7:29 PM, Jack Zhou wrote:
Thanks for the quick response, Mike!
that's all fixed in master / rel_1_0 and rel_0_9 branches (as you know I
like to fix these deep polymorphic loader issues ASAP)
On Mon, Jun 30, 2014 at 4:26 PM, Mike Bayer mike...@zzzcomputing.com
SQLAlchemy's API allows CREATE INDEX via the Index construct:
http://docs.sqlalchemy.org/en/rel_0_9/core/constraints.html?highlight=index#indexes
On 6/30/14, 6:21 PM, Phillip Aquilina wrote:
Using postgresql, I have a JSON type column. My understanding from
their docs was that only jsonb
Thanks for replying. I've read through that doc and I still don't see how
that addresses my question. Is there somewhere in there that describes how
to create an index on a json field? It seems like to me it's simple to
create an index on a column but this would be creating an index on nested
I'm not familiar with any other style of index for this column type.
If you can show me at
http://www.postgresql.org/docs/9.4/static/datatype-json.html or wherever
what specific DDL you're looking for, you can simply emit it using
engine.execute(ddl).
On 6/30/14, 11:02 PM, Phillip Aquilina
per the SO answer, you're looking for CREATE INDEX ON
publishers((info-'name'));. Either you can emit this directly as a
string, or use Index, just as it states:
from sqlalchemy import create_engine, Integer, Index, Table, Column,
MetaData
from sqlalchemy.dialects.postgresql import JSON
e =
15 matches
Mail list logo