On Tue, Jun 26, 2018 at 8:09 AM, Eugene Prikazchikov wrote:
> Traceback:
>
> Traceback (most recent call last):
> File "1.py", line 15, in
> s.query(A).options(with_expression(A.expr, text('x')))
> File
> ".venv/lib/python3.6/site-packages/sqlalchemy/orm/strategy_options.py", line
>
definitely, triyng to match up python .now() with database .now() is
not going to work, in particular since .now() in the database is often
the transaction start time, not the actual time.
On Tue, Jun 26, 2018 at 12:28 PM, Jonathan Vanasco
wrote:
> the difference is possibly because this is
the difference is possibly because this is calculated in Python, each time
it is executed:
datetime.datetime.now()
this is calculated in Postgres, and refers to the beginning of the
transaction; it does not change across the transaction.
NOW()
--
SQLAlchemy -
The Python SQL Toolkit and
Hi,
I have a class like:
class SQLClass(db):
json_field = Column(sqlalchemy.dialects.postgresql.JSONB)
I'm doing something like:
session.add(
SQLClass(json_field = dict(
key = [value1]
)
))
session.commit()
slq_class_obj = session.query(SQLClass).first()
new_dict =
On Tue, Jun 26, 2018 at 3:56 PM, Victor Reichert
wrote:
> Hi,
>
> I have a class like:
>
> class SQLClass(db):
>
> json_field = Column(sqlalchemy.dialects.postgresql.JSONB)
>
> I'm doing something like:
>
> session.add(
> SQLClass(json_field = dict(
> key = [value1]
> )
> ))
>
I found strange behavior.
I have a model:
class User(Base):
__tablename__ = 'test_user'
id = Column(Integer, primary_key=True)
timeout = Column(Integer)
last_receive_time = Column(TIMESTAMP)
I have a next script:
# run several times
session.add( User( timeout=1,
Traceback:
Traceback (most recent call last):
File "1.py", line 15, in
s.query(A).options(with_expression(A.expr, text('x')))
File
".venv/lib/python3.6/site-packages/sqlalchemy/orm/strategy_options.py",
line 1438, in with_expression
False, {"expression": expression})
File
Thanks!
I understand what was happening. I had tried MutableDict, but I think
my data was too complex (a list-valued dictionary) for the basic
implementation. When it didn't work I I got confused and thought
reassigning the value would trigger mutation tracking.
On Tuesday, June 26, 2018 at
I am trying to use TextClause in with_expression and getting error.
Simplest example:
from sqlalchemy import *
from sqlalchemy.orm import *
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class A(Base):
__tablename__ = 'a'
id = Column(Integer,