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
i need convert typesystem to json, but there is no way to find to_json
iused:
class BaseDatabase(orm.Model): fields = {} def __iter__(self): return self.__next__() def __next__(self): for k in self.fields.keys(): if hasattr(self, k): yield (k, getattr(self, k))
class Json(js.JSONEncoder): def default(self, o): if isinstance(o, BaseDatabase): tmp = dict(o) if len(tmp.keys()) == 1 and "id" in tmp.keys(): # ForeignKey return tmp['id'] return tmp return super().default(o)
class Mall(BaseDatabase)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
i need convert typesystem to json, but there is no way to find to_json
iused:
The text was updated successfully, but these errors were encountered: