Exemple #1
0
 def get_expanded_card_data(self, project):
     """Retrieve data for the expanded card."""
     jobboards = self.list_jobboards(project)
     sorted_jobboards = sorted(jobboards,
                               key=lambda j:
                               (-len(j.filters), random.random()))
     return jobboard_pb2.JobBoards(job_boards=sorted_jobboards)
Exemple #2
0
def project_jobboards(user_id, project_id):
    """Retrieve a list of job boards for a project."""
    user_proto = _get_user_data(user_id)
    project = _get_project_data(user_proto, project_id)
    scoring_project = scoring.ScoringProject(project, user_proto.profile,
                                             user_proto.features_enabled, _DB)
    jobboards = scoring_project.list_jobboards()
    sorted_jobboards = sorted(jobboards,
                              key=lambda j: (-len(j.filters), random.random()))
    return jobboard_pb2.JobBoards(job_boards=sorted_jobboards)