Example #1
0
def get_cohort_comments(cohort_uri, reference_uri):
    # NOTE this is not being used = not tested ~ not working
    raise Exception
    cohort_db = _get_cohort_db(cohort_uri)
    cohort_comments = []
    for cohort_comment in cohort_db.comment_set.filter(reference_uri=reference_uri):
        # NOTE: possible performance problem!!
        comment = comment_model.get_comment(cohort_comment.comment_uri)
        cohort_comments += [comment]
        # yield comment
    return cohort_comments
Example #2
0
def get_cohort_comments(cohort_uri, reference_uri):
    #NOTE this is not being used = not tested ~ not working
    raise Exception
    cohort_db = _get_cohort_db(cohort_uri)
    cohort_comments = []
    for cohort_comment in cohort_db.comment_set.filter(
            reference_uri=reference_uri):
        #NOTE: possible performance problem!!
        comment = comment_model.get_comment(cohort_comment.comment_uri)
        cohort_comments += [comment]
        #yield comment
    return cohort_comments
Example #3
0
def add_comment_to_cohort(comment_uri, cohort_uri, reference_uri):
    # NOTE this is not being used = not tested ~ not working
    raise Exception
    # NOTE maybe create comment and update comment reference to simplify use?
    cohort_db = _get_cohort_db(cohort_uri)
    cohort_comment_db = db.CohortComment(cohort=cohort_db, comment_uri=comment_uri, reference_uri=reference_uri)

    cohort_comment_db.save()

    # TODO update the reference for the comment to point to this cohort comment
    # NOTE maybe eliminate this psuedo resource by using a combined URI cohort+ref

    return comment_model.get_comment(comment_uri)
Example #4
0
def add_comment_to_cohort(comment_uri, cohort_uri, reference_uri):
    #NOTE this is not being used = not tested ~ not working
    raise Exception
    #NOTE maybe create comment and update comment reference to simplify use?
    cohort_db = _get_cohort_db(cohort_uri)
    cohort_comment_db = db.CohortComment(cohort=cohort_db,
                                         comment_uri=comment_uri,
                                         reference_uri=reference_uri)

    cohort_comment_db.save()

    #TODO update the reference for the comment to point to this cohort comment
    #NOTE maybe eliminate this psuedo resource by using a combined URI cohort+ref

    return comment_model.get_comment(comment_uri)