MCPcopy Index your code
hub / github.com/diffgram/diffgram / new

Method new

shared/database/discussion/discussion.py:214–243  ·  view source on GitHub ↗
(session,
            title: str = None,
            description: str = None,
            member_created_id: int = None,
            project_id: int = None,
            status: str = None,
            marker_frame_number: int = None,
            marker_data: dict = None,
            marker_type: str = None,
            type: str = 'issue',
            add_to_session: bool = True,
            flush_session: bool = True)

Source from the content-addressed store, hash-verified

212
213 @staticmethod
214 def new(session,
215 title: str = None,
216 description: str = None,
217 member_created_id: int = None,
218 project_id: int = None,
219 status: str = None,
220 marker_frame_number: int = None,
221 marker_data: dict = None,
222 marker_type: str = None,
223 type: str = 'issue',
224 add_to_session: bool = True,
225 flush_session: bool = True):
226 discussion = Discussion(
227 title = title,
228 description = description,
229 member_created_id = member_created_id,
230 project_id = project_id,
231 marker_frame_number = marker_frame_number,
232 marker_data = marker_data,
233 marker_type = marker_type,
234 status = status,
235 type = type,
236 )
237 if add_to_session:
238 session.add(discussion)
239 if flush_session:
240 session.flush()
241 # Default relation to project.
242 discussion.attach_element(session, {'type': 'project', 'id': project_id})
243 return discussion
244
245 @staticmethod
246 def get_by_id(session, id: int):

Callers 1

attach_elementMethod · 0.45

Calls 3

attach_elementMethod · 0.95
DiscussionClass · 0.85
addMethod · 0.45

Tested by

no test coverage detected