class Article(Base):
...
name = Column(Text, unique=True)
...
@validates('name')
def validate_name(self, key, value):
assert value != ''
return value
class Article(Base):
...
name = Column(Text, CheckConstraint('name!=""')
...