-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
first experiments of doing shallow ctors on Schema__MGraph__Json__Nod…
…e and Schema__MGraph__Json__Node__Value__Data
- Loading branch information
Showing
4 changed files
with
46 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 14 additions & 1 deletion
15
mgraph_ai/providers/json/schemas/Schema__MGraph__Json__Node.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,17 @@ | ||
from osbot_utils.helpers.Obj_Id import Obj_Id | ||
from mgraph_ai.mgraph.schemas.Schema__MGraph__Node import Schema__MGraph__Node | ||
|
||
class Schema__MGraph__Json__Node(Schema__MGraph__Node): | ||
pass | ||
|
||
def __init__(self, **kwargs): | ||
#return super().__init__(**kwargs) | ||
node_data = kwargs.get('node_data') or self.__annotations__['node_data']() | ||
node_id = kwargs.get('node_id' ) or Obj_Id() | ||
node_type = kwargs.get('node_type') or self.__class__ | ||
node_dict = dict(node_data = node_data, | ||
node_id = node_id , | ||
node_type = node_type) | ||
object.__setattr__(self, '__dict__', node_dict) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters