MCPcopy
hub / github.com/diffgram/diffgram / new

Method new

shared/database/discussion/discussion_comment.py:77–101  ·  view source on GitHub ↗
(
            session: object,
            content: str = None,
            member_created_id: int = None,
            project_id: int = None,
            member_updated_id: int = None,
            discussion_id: int = None,
            user_id: int = None,
            add_to_session: bool = True,
            flush_session: bool = True
    )

Source from the content-addressed store, hash-verified

75
76 @staticmethod
77 def new(
78 session: object,
79 content: str = None,
80 member_created_id: int = None,
81 project_id: int = None,
82 member_updated_id: int = None,
83 discussion_id: int = None,
84 user_id: int = None,
85 add_to_session: bool = True,
86 flush_session: bool = True
87 ):
88 comment = DiscussionComment(
89 content = content,
90 project_id = project_id,
91 user_id = user_id,
92 discussion_id = discussion_id,
93 member_created_id = member_created_id,
94 member_updated_id = member_updated_id,
95 )
96 if add_to_session:
97 session.add(comment)
98 if flush_session:
99 session.flush()
100
101 return comment
102
103 @staticmethod
104 def get_by_id(session: object, id: int):

Callers

nothing calls this directly

Calls 2

DiscussionCommentClass · 0.85
addMethod · 0.45

Tested by

no test coverage detected