Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

sqlalchemy validation

class Article(Base):
    ...
    name = Column(Text, unique=True)
    ...

    @validates('name')
    def validate_name(self, key, value):
        assert value != ''
        return value
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #sqlalchemy #validation
ADD COMMENT
Topic
Name
2+3 =