コード例 #1
0
    class TestModel(Model):
        _name = CharField(name='name')
        _password = CharField(name='password')

        def set_password(self, raw_password):
            self.name = raw_password
            self._password = raw_password
コード例 #2
0
class Movement(Model):
    __table_name__ = 'movements'
    _type = CharField(choices=MovementType)
    _date = DateField()
    _value = IntegerField()
    _note = CharField()
    _category = ForeignKeyField(to=Category)
コード例 #3
0
class Category(Model):
    __table_name__ = 'categories'
    _name = CharField()
    _description = CharField()
コード例 #4
0
 class ForeignReadOnly(Model):
     _name = CharField(name='name')
     _category = ForeignKeyField(to=Category, name='category', read_only=True)
コード例 #5
0
 class ReadOnly(Model):
     _name = CharField(name='name')
     _immutable = IntegerField(name='immutable', read_only=True)
コード例 #6
0
 class TestAnnotation(Model):
     _name = CharField(name='name')
     _value = IntegerField(name='value')
     _test = CharField(name='test')
     _category = ForeignKeyField(to=Category, name='category')
コード例 #7
0
 class Example(Model):
     name = CharField()
コード例 #8
0
 class TestModel2(Model):
     _value2 = CharField()
コード例 #9
0
 class TestModel1(Model):
     _value1 = CharField()
コード例 #10
0
 class TestModel(Model):
     _value = CharField()
コード例 #11
0
 class TestModel(Model):
     _test = CharField(choices=Choices)
コード例 #12
0
    class TestModel(Model):
        _name = CharField(name='name')
        _password = CharField(name='password')

        def get_password(self):
            return f'{self.name} - {self._password}'
コード例 #13
0
 class Model1(Model):
     _name = CharField(name='name')
コード例 #14
0
 class TestModel(Model):
     _name = CharField(name='name')