Esempio n. 1
0
 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)
     )
Esempio n. 2
0
    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:])
        ))
Esempio n. 3
0
 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__),
     )
Esempio n. 4
0
 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__),
     )
Esempio n. 5
0
 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))
Esempio n. 6
0
 def category(self):
     return sa.orm.relationship('Category',
                                backref=pluralize(ENTRY_TABLE_NAME))
Esempio n. 7
0
 def series(self):
     return sa.orm.relationship('Series',
                                backref=pluralize(ENTRY_TABLE_NAME))
Esempio n. 8
0
 def owner(self):
     return sa.orm.relationship('User', backref=pluralize(ENTRY_TABLE_NAME))
Esempio n. 9
0
 def category(self):
     return sa.orm.relationship(
         'Category'
         , backref=pluralize(ENTRY_TABLE_NAME)
     )
Esempio n. 10
0
 def series(self):
     return sa.orm.relationship(
         'Series'
         , backref=pluralize(ENTRY_TABLE_NAME)
     )
Esempio n. 11
0
 def owner(self):
     return sa.orm.relationship(
         'User'
         , backref=pluralize(ENTRY_TABLE_NAME)
     )