Thank you for the fast reply and the fix!
I case somebody encounters this problem and doesn't want from a
checkout, workarounds are:
In the init of the Example class, access the point or set to None:
class Example(Base):
__tablename__ = 'example'
id = Column(Integer, primary_key=True)
x = Column(Integer)
y = Column(Integer)
point = composite(Point, x, y)
def __init__(self):
self.point = None
Or access the point first like:
fail = Example()
fail.point
get_history(fail, 'point')
Thanks again!
On Dec 7, 7:25 pm, Michael Bayer <[email protected]> wrote:
> On Dec 7, 2011, at 10:55 AM, Laurence De Jong wrote:
>
>
>
> > Hi all!
>
> > I'm using 0.7.3 and I am facing a problem.
>
> > The problem is that I'm using the get_history function from
> > sqlalchemy.orm.attributes to get the history from a composite property
> > of an object. When the composite property is set, everything is ok,
> > but when it is not set, I get an error.
>
> > It looks like an instance of a Point will be created without
> > parameters.
>
> > Is this a programming error?
>
> yeah that is a bug, thanks for the good-to-go test case, it was easy enough
> to commit with a one liner fix. You can pull out the latest tip and it'll
> be in 0.7.4. http://hg.sqlalchemy.org/sqlalchemy/archive/default.tar.gz
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en.