Hi devs,
is there a simple way how to make an ORM property read only? I need to
fetch the column from database so it will be accessible through the
mapped class, but I need that the property will be never updated back
to the database (in case I add the object to the session and do
commit).
On Aug 29, 2010, at 10:00 AM, Petr Kobalíček wrote:
Hi devs,
is there a simple way how to make an ORM property read only? I need to
fetch the column from database so it will be accessible through the
mapped class, but I need that the property will be never updated back
to the database (in
On Aug 28, 2010, at 1:58 PM, Adrià Mercader wrote:
Hi everybody,
I'm using SQLAlchemy for the first time, and everything worked as a
charm until I got stuck with a double join.
That's the expression I'm trying to perform to get a list of the
linked articles from a given article, (knowing
print session.query(session.Company).all()
File /usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.6.3-py2.6-
linux-x86_64.egg/sqlalchemy/orm/query.py, line 1453, in all
return list(self)
File /usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.6.3-py2.6-
Full Traceback (most recent call last):
File /usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.6.3-py2.6-
linux-x86_64.egg/sqlalchemy/orm/query.py, line 1453, in all
return list(self)
File /usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.6.3-py2.6-
On Aug 17, 2010, at 6:23 AM, jean-philippe serafin wrote:
ok, everything is working as expected
thanks, SQLAlchemy just rocks!
I've added a patch in ticket 1895:
http://www.sqlalchemy.org/trac/ticket/1895
The patch passes all tests, and will most likely be applied for SQLAlchemy 0.7
Hi Petr,
You may want to have a look at this link
http://www.sqlalchemy.org/docs/mappers.html#building-query-enabled-properties
Setting the viewonly=True property in your mapper configuration does
exactly what you want. I've used it a couple of times in my own
project and it works.
-Mark
On
Hi All
Just to put closure on this issue, I finally sorted it out as a bug in the
connector. This has now been resolved and the latest build has the correction.
:-) As a matter of interest, the line db.conn.protocol should have been
db.protocol.. Anyway - all's well that ends well.. :-)