We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Tuple[]
NamedTuple
This is a separate issue to add NamedTuple/Tuple support, broken out from #65
Tuple
I have this Pydantic model that I want to allow users to edit in the UI:
from typing import NamedTuple class SemVer(NamedTuple): major: int minor: int = 0 patch: int = 0 def __new__(cls, *args, **kwargs): # allow creating from string SemVer('1.2.3') or SemVer(1, 2, 3) if len(args) == 1 and isinstance(args, str): args = (int(chunk) for chunk in args[0].split('.')) return cls(*args, **kwargs) class Dependency(models.Model): min_version: SemVer = SchemaField(default=(0,0,1))
Currently trying to render the Admin UI produces a number of errors in the UI, but the key one for this issue is:
(!) Error: Error while creating EditorState: Invalid schema: Schema of type 'array' must have a key called 'items'
I have also seen this error when trying to nest SemVer inside a different Pydantic BaseModel:
SemVer
The text was updated successfully, but these errors were encountered:
No branches or pull requests
This is a separate issue to add
NamedTuple
/Tuple
support, broken out from #65I have this Pydantic model that I want to allow users to edit in the UI:
Currently trying to render the Admin UI produces a number of errors in the UI, but the key one for this issue is:
I have also seen this error when trying to nest
SemVer
inside a different Pydantic BaseModel:The text was updated successfully, but these errors were encountered: