I am getting stuck trying to upgrade to 0.8.x, as I can't get correlation
to work with nested subquery in column property. Here's a slightly absurd
example for illustration:
from sqlalchemy import *
from sqlalchemy.orm import *
from sqlalchemy.ext.declarative import declarative_base
Base =
There are a few places in my code that does `q.filter(None)`, e.g.
something like this:
def base_filter(self):
# subclasses may set this, or not
pass
def base_query(self):
q = self.model_cls.query
q = q.filter(self.base_filter())
return q
On Tuesday, October 9, 2012 10:19:34 PM UTC+8, Michael Bayer wrote:
yeah, the whole FreeTDS story is awful, I don't understand any of it
either. I'm still at wave a dead chicken stage with FreeTDS (
http://dictionary.reference.com/browse/wave+a+dead+chicken).
The ODBC Driver 1.0 for
This is semi-related to the latest post from Kent. I just noticed that I
have been abusing the autoflush on begin behavior (by the
_take_snapshot() method in orm/session.py) to create additional instances
within the after_flush Session Event. Here's some sample code to illustrate
that:
In the documentation for joined table inheritance [1], it mentions that:
Note that above, the Engineer.id attribute, since it shares the same
attribute name as the Person.id attribute, will in fact represent the
people.id and engineers.id columns together, and will render inside a query
as
On Wednesday, June 24, 2009 10:25:09 PM UTC+8, Michael Bayer wrote:
Beeno wrote:
Hello
Sqlalchemy appears to be aliasing each column in a SELECT statement as
a concatenation of the schema, table name and column name. The
resulting alias exceeds DB2's 30 character limit for a column.
I too encountered the same problem that wasted me days, until I caught
pdtb_sqla_queries with my very limited memory profiling skill.
I have actually filed a bug here:
https://github.com/Pylons/pyramid_debugtoolbar/issues/51
and there is a separate issue to make it less leaky:
Is it possible to get a contains_eager collection to follow the
order_by defined in the relationship? It seems like with eager
loading, the order_by defined will just be ignored (which I think make
sense, just wondering if there is a better way than manual sorting).
Here's some sample code to
Using the second example in
http://www.sqlalchemy.org/docs/orm/mapper_config.html#mapping-a-class-against-multiple-tables,
how should I define relationship properties KeywordUser.keyword and
KeywordUser.user? I tried different primaryjoin's, but when used as
filter, e.g.
__abstract__ = True on the
class - the @declared_attr's on columns should be recognized in that case.
You wouldn't want to have __tablename__ = 'test' on such a class either
since it isn't mapped.
On Sep 23, 2011, at 12:48 AM, Yap Sok Ann wrote:
With this code:
from
With this code:
from sqlalchemy.ext.declarative import declarative_base, declared_attr
from sqlalchemy.schema import Column
from sqlalchemy.types import Integer, String
Base = declarative_base()
class Mixin(object):
@declared_attr
def attr2(cls):
return Column(String(20),
Using the discriminator_on_association.py example, if I create a
Customer instance without specifying the addresses attribute, the for-
loop at the end will throw exception:
AttributeError: 'NoneType' object has no attribute 'addresses'
It works if I specify addresses=[], but that sounds like
With the following code:
#
from sqlalchemy.engine import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import column_property, relation
from sqlalchemy.orm import scoped_session, sessionmaker
from
In the 07Migration wiki, there is this line:
Index('name', name=idx_name)
which doesn't work for me. I have to change it to:
Index('idx_name', 'name')
Is it a typo or some python 3 only syntax?
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To
This is related to topic need 0.6_beta2-compat declarative meta
http://groups.google.com/group/sqlalchemy/browse_thread/thread/ae7cb9d2ab0b9cca
Prior to version 0.6, I use the following code to automatically add a
primary key if the table doesn't have one defined:
from sqlalchemy.ext.declarative
On Sep 22, 11:37 pm, Michael Bayer mike...@zzzcomputing.com wrote:
On Sep 22, 2010, at 4:30 AM, Yap Sok Ann wrote:
This is related to topic need 0.6_beta2-compat declarative meta
http://groups.google.com/group/sqlalchemy/browse_thread/thread/ae7cb9...
Prior to version 0.6, I use
On Aug 22, 2:12 am, Michael Bayer mike...@zzzcomputing.com wrote:
On Aug 21, 2010, at 1:38 PM, Michael Bayer wrote:
On Aug 19, 2010, at 6:38 AM, Yap Sok Ann wrote:
With declarative base, is it possible to use a relationship within a
column_property?
you mean, as I am seeing below
With declarative base, is it possible to use a relationship within a
column_property? Here's some sample code to illustrate what I want to
achieve:
from sqlalchemy.engine import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import column_property,
I use a MapperExtension to automatically put the current timestamp
into a updated_at column for all entities. This works fine except when
related entities get involved. Let's say I have a Many-To-One relation
between employees and departments. If I switch the department for an
employee, even
19 matches
Mail list logo