New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inline model creation #113

Closed
samuelcolvin opened this Issue Jan 6, 2018 · 0 comments

Comments

1 participant
@samuelcolvin
Owner

samuelcolvin commented Jan 6, 2018

class LabelModel(BaseModel):
    name: str
    machine_name: str

class XModel(BaseModel):
    labels1: List[LabelModel]
    labels2: List[create_model('LabelModel', name=(str, ...), machine_name=(str, ...))]

Here labels1 is the same as labels2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment