Skip to content

Instantly share code, notes, and snippets.

@richardjpope
Created December 20, 2016 13:35
Show Gist options
  • Save richardjpope/cfc7ef0f3722db1e9c9d150106d73464 to your computer and use it in GitHub Desktop.
Save richardjpope/cfc7ef0f3722db1e9c9d150106d73464 to your computer and use it in GitHub Desktop.
def recommend_union(job, employer):
results = []
job = job.lower()
employer = employer.lower()
if 'journalist' in job:
results.append(models.Union.objects.get(name='National Union of Journalists'))
if 'uber' in employer:
results.append(models.Union.objects.get(name='GMB'))
if 'picturehouse' in employer or 'ritzy' in employer:
results.append(models.Union.objects.get(name='Broadcasting, Entertainment, Cinematograph and Theatre Union'))
if results == []:
results.append(models.Union.objects.get(name='Unite'))
results.append(models.Union.objects.get(name='GMB'))
return results
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment