def tags(self): return sa.orm.relationship( 'Tag' , secondary=ENTRY_TAG_ASSOCIATION_TABLE_NAME , passive_deletes=True , passive_updates=True , backref=pluralize(ENTRY_TABLE_NAME) )
def __tablename__(cls): """Convert CamelCase class name to underscores_between_words table name.""" name = cls.__name__.replace('Mixin', '') return pluralize(( name[0].lower() + re.sub(r'([A-Z])', lambda m:"_" + m.group(0).lower(), name[1:]) ))
def users(self): """Relationship for users belonging to this group""" return sa.orm.relationship( 'User', secondary=UserGroupMixin.__tablename__, # order_by='%s.user.username' % UserMixin.__tablename__, passive_deletes=True, passive_updates=True, backref=pluralize(GroupMixin.__tablename__), )
def tags(self): return sa.orm.relationship('Tag', secondary=ENTRY_TAG_ASSOCIATION_TABLE_NAME, passive_deletes=True, passive_updates=True, backref=pluralize(ENTRY_TABLE_NAME))
def category(self): return sa.orm.relationship('Category', backref=pluralize(ENTRY_TABLE_NAME))
def series(self): return sa.orm.relationship('Series', backref=pluralize(ENTRY_TABLE_NAME))
def owner(self): return sa.orm.relationship('User', backref=pluralize(ENTRY_TABLE_NAME))
def category(self): return sa.orm.relationship( 'Category' , backref=pluralize(ENTRY_TABLE_NAME) )
def series(self): return sa.orm.relationship( 'Series' , backref=pluralize(ENTRY_TABLE_NAME) )
def owner(self): return sa.orm.relationship( 'User' , backref=pluralize(ENTRY_TABLE_NAME) )