(self, comment)
Add comment to event.

        Args:
            comment: Comment string.

        Raises:
            RuntimeError: if no sketch is present.
Add comment to event.
Add comment to event .
def add_comment(self, comment):
        """Add comment to event.

        Args:
            comment: Comment string.

        Raises:
            RuntimeError: if no sketch is present.
        """
        if not self.sketch:
            raise RuntimeError('No sketch provided.')

        searchindex = SearchIndex.query.filter_by(
            index_name=self.index_name).first()
        db_event = SQLEvent.get_or_create(
            sketch=self.sketch.sql_sketch, searchindex=searchindex,
            document_id=self.event_id)
        comment = SQLEvent.Comment(comment=comment, user=None)
        db_event.comments.append(comment)
        db_session.add(db_event)
        db_session.commit()
        self.add_label(label='__ts_comment')
def add_comment ( self , comment ) : if not self . sketch : raise RuntimeError ( 'No sketch provided.' ) searchindex = SearchIndex . query . filter_by ( index_name = self . index_name ) . first ( ) db_event = SQLEvent . get_or_create ( sketch = self . sketch . sql_sketch , searchindex = searchindex , document_id = self . event_id ) comment = SQLEvent . Comment ( comment = comment , user = None ) db_event . comments . append ( comment ) db_session . add ( db_event ) db_session . commit ( ) self . add_label ( label = '__ts_comment' )