'Set the realm entity to the project\'s realm entity'

@staticmethod
def project_activity_realm_entity(table, record):

    activity_id = record.id
    db = current.db
    table = db.project_activity
    ptable = db.project_project
    query = ((table.id == activity_id) & (table.project_id == ptable.id))
    project = db(query).select(ptable.realm_entity, limitby=(0, 1)).first()
    try:
        return project.realm_entity
    except:
        return None
