-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add support for custom scalars #33
Comments
In my opinion, there are several objectives we need to implement:
|
Maybe we should create a new metaclass called from pygraphy import ScalarType
class Scalar(metaclass=ScalarType):
# defined in pygraphy, implement some default method
...
class UUID(Scalar):
def load(self, string: str) -> pyUUID:
return pyUUID(string)
def dump(self) -> str:
return str(self.value) # value is defined in `Scalar` class maybe then UUID can be used as a normal type when declaring models: class Foo(pygraphy.Object):
id: UUID |
Should I solve the first three items on this issue? |
Yeah, I am glad to hear that. |
No description provided.
The text was updated successfully, but these errors were encountered: