Answer the question
In order to leave comments, you need to log in
How to do full text search in peewee (MySQL)?
Hello colleagues!
There are following data models in peewee
# Таблица организационно-правовых форм (olfs)
class Olfs(BaseModel):
name = CharField()
# Таблицы юридических лиц нашей организации (entityes)
class Entityes(BaseModel):
name = CharField()
requisites = TextField()
olf = ForeignKeyField(Olfs, related_name='entity_olf')
# Таблица контрагентов (contractors)
class Contractors(BaseModel):
name = CharField()
requisites = TextField()
olf = ForeignKeyField(Olfs, related_name='contractor_olf')
# Таблица contracts, содержит договоры
class Contracts(BaseModel):
number = CharField()
enter_date = DateField()
subject = TextField()
contractor = ForeignKeyField(Contractors, related_name='contractor')
entity = ForeignKeyField(Entityes, related_name='entity')
contracts = (Contracts.select(Contracts, Contractors, Entityes)
.join(Contractors)
.switch(Contracts)
.join(Entityes))
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question