forked from mozmeao/lumbergh
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Listing. Details page. Convert views to class based generic views. Add location lists Remove unused template. Update university app to new Position type. Run sync_greenhouse job with cron.
- Loading branch information
1 parent
8c38a69
commit da1160d
Showing
22 changed files
with
231 additions
and
463 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,25 @@ | ||
from django import forms | ||
|
||
import utils | ||
from careers.careers.models import Position | ||
|
||
|
||
class PositionFilterForm(forms.Form): | ||
team = forms.ChoiceField(widget=forms.Select(attrs={'autocomplete': 'off'})) | ||
position_type = forms.ChoiceField(widget=forms.Select(attrs={'autocomplete': 'off'})) | ||
location = forms.ChoiceField(choices=( | ||
('', 'All Locations'), | ||
('remote', 'Remote'), | ||
|
||
# Continents | ||
('europe', 'Europe'), | ||
('latinamerica', 'Latin America'), | ||
('northamerica', 'North America'), | ||
|
||
# Young money | ||
('bayarea', 'Bay Area'), | ||
|
||
# Cities | ||
('berlin', 'Berlin'), | ||
('boston', 'Boston'), | ||
('london', 'London'), | ||
('mountainview', 'Mountain View'), | ||
('newzealand', 'New Zealand'), | ||
('paris', 'Paris'), | ||
('portland', 'Portland'), | ||
('sanfrancisco', 'San Francisco'), | ||
('toronto', 'Toronto'), | ||
('vancouver', 'Vancouver'), | ||
), widget=forms.Select(attrs={'autocomplete': 'off'})) | ||
location = forms.ChoiceField(widget=forms.Select(attrs={'autocomplete': 'off'})) | ||
|
||
def __init__(self, *args, **kwargs): | ||
super(PositionFilterForm, self).__init__(*args, **kwargs) | ||
|
||
# Populate position type choices dynamically. | ||
types = utils.get_all_position_types() | ||
self.fields['position_type'].choices = [('', 'All Positions')] + [(k, k) for k in types] | ||
locations = Position.locations() | ||
self.fields['location'].choices = ( | ||
[('', 'All Locations')] + [(l, l) for l in locations]) | ||
|
||
types = Position.position_types() | ||
self.fields['position_type'].choices = ( | ||
[('', 'All Positions')] + [(k, k) for k in types]) | ||
|
||
categories = utils.get_all_categories() | ||
self.fields['team'].choices = [('', 'All Categories')] + [(k, k) for k in categories] | ||
categories = Position.categories() | ||
self.fields['team'].choices = ( | ||
[('', 'All Categories')] + [(k, k) for k in categories]) |
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,27 @@ | ||
from datetime import date | ||
|
||
from django.conf import settings | ||
|
||
import factory | ||
from django_jobvite import models as jobvite_models | ||
from factory import fuzzy | ||
|
||
|
||
class FuzzyDateString(fuzzy.FuzzyDate): | ||
def fuzz(self): | ||
date = super(FuzzyDateString, self).fuzz() | ||
return date.strftime('%m/%d/%Y') | ||
|
||
|
||
class CategoryFactory(factory.DjangoModelFactory): | ||
FACTORY_FOR = jobvite_models.Category | ||
name = factory.Sequence(lambda n: 'category {0}'.format(n)) | ||
slug = factory.Sequence(lambda n: 'category-{0}'.format(n)) | ||
from careers.careers.models import Position | ||
|
||
|
||
class PositionFactory(factory.DjangoModelFactory): | ||
FACTORY_FOR = jobvite_models.Position | ||
category = factory.SubFactory(CategoryFactory) | ||
FACTORY_FOR = Position | ||
job_id = factory.Sequence(lambda n: 'jobid{0}'.format(n)) | ||
title = factory.Sequence(lambda n: 'Job Title {0}'.format(n)) | ||
job_type = fuzzy.FuzzyChoice(['Full-Time', 'Part-Time', 'Contractor', 'Intern']) | ||
requisition_id = fuzzy.FuzzyInteger(0) | ||
department = fuzzy.FuzzyChoice(['Data Analytics', 'Engineering']) | ||
location = fuzzy.FuzzyChoice(['Mountain View', 'San Francisco', 'Remote', 'Toronto']) | ||
date = FuzzyDateString(date(2010, 1, 1)) | ||
description = factory.Sequence(lambda n: 'Job Description {0}'.format(n)) | ||
source = 'gh' | ||
position_type = fuzzy.FuzzyChoice(['Full-Time', 'Part-Time', 'Contractor', 'Intern']) | ||
|
||
@factory.lazy_attribute | ||
def apply_url(self): | ||
url = 'http://hire.jobvite.com/CompanyJobs/Apply.aspx?c=qpX9Vfwaj&j={0}' | ||
return url.format(self.job_id) | ||
|
||
@factory.lazy_attribute | ||
def detail_url(self): | ||
return 'http://hire.jobvite.com/CompanyJobs/Job.aspx?c=qpX9Vfwaj&j={0}'.format(self.job_id) | ||
if self.source == 'gh': | ||
url = 'https://boards.greenhouse.io/{}/jobs/{}'.format( | ||
settings.GREENHOUSE_BOARD_TOKEN, | ||
self.job_id) | ||
return url.format(self.job_id) |
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
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.