MCPcopy Create free account
hub / github.com/diffgram/diffgram / new

Method new

shared/database/event/event.py:254–329  ·  view source on GitHub ↗

Generally we always want a member_id BUT till we have a better system to detect it there are some cases where we don't record it yet (ie brain training) As we add various checks, conditions, triggers etc. it's useful to have this as a generic "new" m

(session,
            kind = None,
            member_id = None,
            success = None,
            error_log = None,
            description = None,
            link = None,
            project_id = None,
            task_id = None,
            directory_id = None,
            run_time = None,
            page_name = None,
            object_type = None,
            job_id = None,
            email = None,
            member = None,
            input_id = None,
            file_id = None,
            action_id = None,
            workflow_id = None,
            report_data = None,
            report_template_id = None,
            report_template_data = None,
            add_to_session = True,
            flush_session = True,
            extra_metadata = None
            )

Source from the content-addressed store, hash-verified

252 exchange = Exchanges.events.value)
253 @staticmethod
254 def new(session,
255 kind = None,
256 member_id = None,
257 success = None,
258 error_log = None,
259 description = None,
260 link = None,
261 project_id = None,
262 task_id = None,
263 directory_id = None,
264 run_time = None,
265 page_name = None,
266 object_type = None,
267 job_id = None,
268 email = None,
269 member = None,
270 input_id = None,
271 file_id = None,
272 action_id = None,
273 workflow_id = None,
274 report_data = None,
275 report_template_id = None,
276 report_template_data = None,
277 add_to_session = True,
278 flush_session = True,
279 extra_metadata = None
280 ):
281 """
282 Generally we always want a member_id
283 BUT till we have a better system to detect it there
284 are some cases where we don't record it yet (ie brain training)
285
286 As we add various checks,
287 conditions, triggers etc. it's useful to have this
288 as a generic "new" method. Also means we can "force"
289 having a kind, etc...
290
291 """
292 if member:
293 member_id = member.id
294
295 user = member.user
296 if user:
297 email = user.email
298 event = Event(
299 kind = kind,
300 member_id = member_id,
301 success = success,
302 error_log = error_log,
303 description = description,
304 link = link,
305 project_id = project_id,
306 task_id = task_id,
307 job_id = job_id,
308 directory_id = directory_id,
309 run_time = run_time,
310 object_type = object_type,
311 input_id = input_id,

Callers 1

__new_event_threadedMethod · 0.45

Calls 4

broadcastMethod · 0.95
EventClass · 0.85
track_userMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected