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
class Movement(Model): __table_name__ = 'movements' _type = CharField(choices=MovementType) _date = DateField() _value = IntegerField() _note = CharField() _category = ForeignKeyField(to=Category)
class Category(Model): __table_name__ = 'categories' _name = CharField() _description = CharField()
class ForeignReadOnly(Model): _name = CharField(name='name') _category = ForeignKeyField(to=Category, name='category', read_only=True)
class ReadOnly(Model): _name = CharField(name='name') _immutable = IntegerField(name='immutable', read_only=True)
class TestAnnotation(Model): _name = CharField(name='name') _value = IntegerField(name='value') _test = CharField(name='test') _category = ForeignKeyField(to=Category, name='category')
class Example(Model): name = CharField()
class TestModel2(Model): _value2 = CharField()
class TestModel1(Model): _value1 = CharField()
class TestModel(Model): _value = CharField()
class TestModel(Model): _test = CharField(choices=Choices)
class TestModel(Model): _name = CharField(name='name') _password = CharField(name='password') def get_password(self): return f'{self.name} - {self._password}'
class Model1(Model): _name = CharField(name='name')
class TestModel(Model): _name = CharField(name='name')