Skip to content

Add an option to exlcude basic models from mappings #13

Discussion options

You must be logged in to vote

Ok, I've tested it, this works, and it is more pythonic way. You have one base model, but two parents:

class BaseModelParent(esorm.ESBaseModel):
    class ESConfig:
        id_field = 'f_str'

    f_str: str
    f_int: int

class BaseModelParentModel(BaseModelParent, esorm.ESModel):
    f_float: float

ESBaseModel classes won't be incuded in mappings. So you can use them as a base structure for multiple models. Also ESConfig settings are inherited from the base model. I think this is what yout want.

Replies: 7 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by wallneradam
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@wallneradam
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
2 participants
Converted from issue

This discussion was converted from issue #12 on July 31, 2024 07:00.