On Monday, February 5, 2018 at 3:19:40 AM UTC-5, Rajesh Rolo wrote:
>
>
> Thank you. .op() seems to have done the trick. I'm going to go with it as
> of now.
>
>>
Please make a test-case of your mistake though, it's important to get this
figured out and patched if there is a bug.
--
On Mon, Feb 5, 2018 at 8:40 AM, Edu Ferreira wrote:
> Hello, i implemented a generic foreign key/relationship, using this example:
> http://docs.sqlalchemy.org/en/latest/_modules/examples/generic_associations/discriminator_on_association.html
>
> In the example addresses is
Ah, that makes sense! Joining with right conditions did the trick:
viewed_by_user, edited_by_user = aliased(User), aliased(User)
query = (session.query(News)
.outerjoin(NewsLog, and_(NewsLog.news_id == News.id,
or_(NewsLog.type_id == 1, NewsLog.type_id
On Mon, Feb 5, 2018 at 8:50 AM, Mikhail Knyazev wrote:
> Hi,
>
> I got a model which has two relationships with same table through a
> secondary table. Relationships are differentiated by a value of a column in
> secondary table. Here is an example:
>
> class NewsLog:
>
On Mon, Feb 5, 2018 at 8:15 AM, Jacek Blocki wrote:
> Mike,
> Thank you for for the tip on _sessions, I think it is worth publishing since
> it can make debugging easier. Regarding documentation it will be good to
> mention session close() is not like file close() and closed
Hi,
I got a model which has two relationships with same table through a
secondary table. Relationships are differentiated by a value of a column in
secondary table. Here is an example:
class NewsLog:
# `User` foreign key
user_id = db.Column(db.Integer)
# 'News' foreign key
Hello, i implemented a generic foreign key/relationship, using this example:
http://docs.sqlalchemy.org/en/latest/_modules/examples/generic_associations/discriminator_on_association.html
In the example addresses is passing in constructor:
session.add_all([
Customer(
name='customer
Mike,
Thank you for for the tip on _sessions, I think it is worth publishing
since it can make debugging easier. Regarding documentation it will be good
to mention session close() is not like file close() and closed session is
just ready for another transaction. Context manager is typically
SQL server may require the use of cursor.callproc() to execute a stores
procedure, see the documentation section on "raw cursor access" for that.
In that case you are better off just executing the textual SQL directly.
Though if the function works inside of a SELECT then sure the same use as
with
What if you wanted to execute a Stored Procedure but from SQL Server
instead of PostgreSQL? Will the same logic work?
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable
Jonathan,
Thank you. .op() seems to have done the trick. I'm going to go with it as
of now.
Thanx,
Rajesh
On Monday, February 5, 2018 at 2:55:50 AM UTC+5:30, Jonathan Vanasco wrote:
>
>
>
> On Sunday, February 4, 2018 at 11:07:49 AM UTC-5, Mike Bayer wrote:
>>
>> You test for NULL with ==
11 matches
Mail list logo