Can you give an example of a forwards-compatible way to modify an
attribute to mark the instance dirty without creating actual net
changes? SA seems quite good at detecting my tricks.
On Oct 27, 6:41 pm, Michael Bayer mike...@zzzcomputing.com wrote:
On Oct 27, 2010, at 11:43 AM, Nikolaj wrote
Hey,
I had trouble deepcopying model instances that use attribute mapped
collection classes. I'm aware that copying an instance implies a
certain use case with a better solution - I accidentally hit this
error when I had an instance as an attribute on an object I was
deepcopy()ing. The following
= Table('testtable', metadata, autoload=True)
Thanks,
N
On Sep 29, 9:58 pm, Michael Bayer mike...@zzzcomputing.com wrote:
On Sep 29, 2010, at 3:37 PM, Nikolaj wrote:
Hi there,
I use the earthdistance and cube modules for PostgreSQL (http://
www.postgresql.org/docs/8.4/interactive
Hi there,
I use the earthdistance and cube modules for PostgreSQL (http://
www.postgresql.org/docs/8.4/interactive/earthdistance.html). These
define some custom types and functions for doing great circle
calculations. I ran into a problem with table introspection in
PGDialect.get_columns().
The
The following test fails in 0.6.4 but not 0.6.3 with AttributeError:
type object 'Person' has no attribute 'foo'. Is this a deliberate
change? It seems a bit weird that every @classproperty on a
declarative subclass is accessed/run on import.
from sqlalchemy import create_engine, Column, String
and its
sideeffects.
Thanks!
On Aug 25, 4:02 pm, Michael Bayer mike...@zzzcomputing.com wrote:
On Aug 25, 2010, at 10:47 AM, Michael Bayer wrote:
On Aug 25, 2010, at 9:37 AM, Nikolaj wrote:
Hello,
I'm struggling to use the Beaker caching example in my project.
Accessing any attribute
Hi there,
I'm exploring the bidirectional adjacency list pattern described in
the documentation (the scalar relationship is intentional):
Person.child = relationship(
Person,
uselist=False,
backref=backref('parent', remote_side=Person.id)
)
However, I'd like to add an additional
I'm on MySQL and trying to create a type that stores enums as
VARCHAR(255). However, the following code still issues an ENUM() DDL.
What am I doing wrong here?
class StringEnum(types.TypeDecorator):
impl = types.Enum
def __init__(self, *args, **kwargs):
super(StringEnum,
, at 8:24 AM, Nikolaj wrote:
I'm on MySQL and trying to create a type that stores enums as
VARCHAR(255). However, the following code still issues an ENUM() DDL.
What am I doing wrong here?
class StringEnum(types.TypeDecorator):
impl = types.Enum
def __init__(self, *args, **kwargs
On Aug 9, 3:38 pm, Michael Bayer mike...@zzzcomputing.com wrote:
its pulling off the types.Enum callable from self.__class__ (which actually
seems unnecessary here, self.impl should be fine), then calling that with the
given arguments. So it should be setting up the native_enum=False part
I have an association object pattern between Person and Item through
PersonItem. Item is subclassed using single-table inheritance into
FooItem and BarItem, with a column named 'foo' on FooItem (although
it's obviously on the same shared table as BarItem).
I'd like to query PersonItem and
I have a one to one relationship between Company and Employee where
Employee is subclassed using joined table inheritance into Manager and
Engineer. I'm trying to query for a list of companies with the
employee eagerloaded including the type-specific columns.
I've been looking at the example at
I'm having trouble inheriting a synonym property from a mixin class.
It obviously works if the call to synonym() is on the child class and
just the get/set methods are left on the mixin. Here is an example:
from sqlalchemy import create_engine, Column, ForeignKey
from sqlalchemy.ext.declarative
I'm using consecutive merge() calls to fetch the same persistent
instance from the Session.
The test case below works as I expected: the first get_item() issues a
SELECT, the second issues an UPDATE, the third does neither.
However, in my large project, using the pattern below (without the
I was trying to add an AttributeExtension to a property from my
MapperExtension but I get this error when trying to access the
property:
AttributeError: 'Mapper' object has no attribute '_props'
Here's a test case:
from sqlalchemy import create_engine, Column
from sqlalchemy.ext.declarative
Ah, it's pretty clear why this happens in Mapper.__init__:
self._configure_extensions()
self._configure_class_instrumentation()
self._configure_properties()
Should MapperExtensions that want to extend properties mess with
mapper._init_properties instead?
On Jul 11, 2:49 pm, Nikolaj nik
Hi there,
I'd like to create a column composite for amounts of money and their
currency. However, the difficulty comes in keeping the currencies in a
separate table and enabling my composite to find this relationship.
Is there some way to set the Currency on my Money type implementation
Hi there,
I'm trying to use the UniqueObject recipe for my project which does
not use declarative_base(). However, I'm having trouble getting this
to work and run into this error:
sqlalchemy.orm.exc.UnmappedInstanceError: Class '__main__.Widget' is
mapped, but this instance lacks
18 matches
Mail list logo