I have a bunch of Mixins for SQL alchemy objects for doing standard stuff
that I use in multiple projects and this all works well by using
@declared_attr like this:

class CategoryMixin(object):
    @declared_attr
    def title(self):
        """ Unique title for the category """
        return sa.Column(sa.Unicode(30), nullable=False, unique=True)

The use of this class would be like this:

Base = declarative_base()

class Category(CategoryMixin, Base):
    pass

but I now want to make some many to many relationships so I need Table()
which requires me to pass it a meta data.  Is there a way to do this in the
same way as the declared attributes?

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to