tcms.core.helpers.comments module

Functions that help access comments of objects.

tcms.core.helpers.comments.add_comment(objs, comments, user, submit_date=None)[source]

Generic approach adding django.comment for an object. params:

@objs: [model, model,] @submit_date: datetime object
>>> from django.contrib.auth.models import User
>>> testuser = User.objects.get(email='user@example.com')
>>> from tcms.testruns.models import TestCaseRun as Run
>>> testrun = Run.objects.get(pk=171675)
>>> comments = 'stupid comments by Homer'
>>> add_comment([testrun,], comments, testuser)