I forget post the error message:
I'm getting an error after perform an insert statement.
class Tag(db.Model):
__tablename__ = "tags"
guid_tag = db.Column(db.BINARY(16), primary_key=True)
id_project = db.Column(db.Integer,db.ForeignKey("projects.id_project"))
project =
I'm getting an error after perform an insert statement.
class Tag(db.Model):
__tablename__ = "tags"
guid_tag = db.Column(db.BINARY(16), primary_key=True)
id_project = db.Column(db.Integer,db.ForeignKey("projects.id_project"))
project = db.relationship(Proyecto,
Dear Simon,
thanks. This works and look great. I should stick this code on my
sleeping pillow. :D
>From viewpoint of SQL or the database this makes totally sense to me.
But my fault (in thinking) was expect that the relationship()
definitions I did in the classes would be enough for SQLA to know
On Mon, Mar 21, 2016 at 5:21 PM, wrote:
> Hi Michal
>
> > q.join(ReferenceAuthor, ReferenceAuthor.c.Index == 0)
>
> Ah, of course! Thank you very much!
>
> But... ;)
>
> This Python code
>
> return self.session.query(Reference) \
>
Hi Michal
> q.join(ReferenceAuthor, ReferenceAuthor.c.Index == 0)
Ah, of course! Thank you very much!
But... ;)
This Python code
return self.session.query(Reference) \
.filter_by(_mark = False) \
.join(Periodical) \
On Mon, Mar 21, 2016 at 05:21:21PM +0100, c.bu...@posteo.jp wrote:
> > ReferenceAuthor is an instance of sqlalchemy.Table, so you can refer
> > to its columns as ReferenceAuthor.c.Index.
>
> Ah nice. But something is still wrong.
> Part of the query:
>
> .join(ReferenceAuthor,
>
> ReferenceAuthor is an instance of sqlalchemy.Table, so you can refer
> to its columns as ReferenceAuthor.c.Index.
Ah nice. But something is still wrong.
Part of the query:
.join(ReferenceAuthor,
ReferenceAuthor.c.Index=0) \
result in
ReferenceAuthor.c.Index=0) \
Can you extract your code into a single standalone script that demonstrates
the problem? This should be possible even with automap; the script can
start by creating just the tables that are involved in this problem
(ideally in an in-memory sqlite db), then use automap to map classes to
those
On Mon, Mar 21, 2016 at 3:05 PM, wrote:
> On 2016-03-20 13:12 Jonathan Vanasco wrote:
> > .contains_eager('_periodical')\ # this lets sqlalchemy
>
> This eager-loading thing is a nice hint. I will use this in the future.
> Thanks.
>
> I
Wow, thanks guys, especially for the sample code! I'm trying to use
the example (and fully understand it at the same time) but am running
into an error. This is the same error that made me look for a way
other than this last week.
sqlalchemy.exc.InvalidRequestError: when initializing mapper
On 2016-03-20 13:12 Jonathan Vanasco wrote:
> .contains_eager('_periodical')\ # this lets sqlalchemy
This eager-loading thing is a nice hint. I will use this in the future.
Thanks.
I haven't specified a important part of my question because I didn't
think about
for the "postgresql JSON function that wants to be in the FROM clause",
there is a way to do this with plain Core API but it generates a
subquery (that's here:
http://docs.sqlalchemy.org/en/rel_1_0/core/tutorial.html#functions ,
scroll down a little in that section), but also I've been
I'm stuck with the need to generate a query of the form like:
SELECT
a.id,
b.name,
jr.*
FROM
a, b outer join jsonb_populate_recordset(b.jrs) as jr(bid numeric, name
varchar) on (TRUE)
WHERE
a.id = b.a_id
First, it's not clear to me how to construct a dynamically defined RECORD
as 'jr(bid
13 matches
Mail list logo