Created
December 20, 2016 13:35
-
-
Save richardjpope/cfc7ef0f3722db1e9c9d150106d73464 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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