'Task representation
@ToDo: Migrate to S3Represent'

@staticmethod
def sync_task_represent(task_id):

    s3db = current.s3db
    ttable = s3db.sync_task
    rtable = s3db.sync_repository
    query = ((ttable.id == task_id) & (rtable.id == ttable.repository_id))
    db = current.db
    task = db(query).select(ttable.resource_name, rtable.name, limitby=(0, 1)).first()
    UNKNOWN_OPT = current.messages.UNKNOWN_OPT
    if task:
        repository = (task[rtable.name] or UNKNOWN_OPT)
        resource = (task[ttable.resource_name] or UNKNOWN_OPT)
        return ('%s:    %s' % (repository, resource))
    else:
        return UNKNOWN_OPT
