That works like a charm, thanks!
On 06/21/2012 12:46 AM, Michael Bayer wrote:
do it like this for now:
class FilterMixin(object):
@declared_attr
def _filters(cls):
cls.filters = association_proxy('_filters', 'filter')
return relationship(cls.filter_class,
I am struggling a little bit with mixin classes. The pattern I am trying
to implement is a mixin-class that adds a list of validated search
queries to a model. A minimised version of the code is below. The
problem I am running into is that putting an association_proxy on a
mixin class does not
do it like this for now:
class FilterMixin(object):
@declared_attr
def _filters(cls):
cls.filters = association_proxy('_filters', 'filter')
return relationship(cls.filter_class,
cascade='all,delete,delete-orphan')
there's a patch for 0.8 only in