-
-
Notifications
You must be signed in to change notification settings - Fork 773
WIP: Add job board #1079
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Add job board #1079
Changes from 2 commits
b25c9ef
7b57a8d
0bad31f
7f28be5
5dc8e2b
4c6ae3b
b56abd3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -85,6 +85,7 @@ | |
| 'linkshortener', | ||
| 'credits', | ||
| 'gitcoinbot', | ||
| 'jobs' | ||
| 'external_bounties', | ||
| 'dataviz', | ||
| ] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| from django.contrib import admin | ||
|
|
||
| # Register your models here. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| from django.apps import AppConfig | ||
|
|
||
|
|
||
| class JobsConfig(AppConfig): | ||
| name = 'jobs' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # Generated by Django 2.0.3 on 2018-05-05 07:04 | ||
|
|
||
| import datetime | ||
| import django.contrib.postgres.fields | ||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| initial = True | ||
|
|
||
| dependencies = [ | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.CreateModel( | ||
| name='Jobs', | ||
| fields=[ | ||
| ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
| ('title', models.CharField(max_length=255)), | ||
| ('description', models.TextField(blank=True, default='')), | ||
| ('apply_location_url', models.URLField()), | ||
| ('apply_location_mail', models.EmailField(max_length=254)), | ||
| ('profile', models.URLField()), | ||
| ('active', models.BooleanField(help_text='When a job is active.')), | ||
| ('skills', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=200), blank=True, default=[], size=None)), | ||
| ('company', models.CharField(max_length=255)), | ||
| ('github_profile', models.CharField(default='', max_length=255)), | ||
| ('expires_date', models.DateTimeField(default=datetime.datetime(2018, 6, 4, 7, 4, 16, 648752))), | ||
| ], | ||
| ), | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| from datetime import datetime, timedelta | ||
|
|
||
| from django.contrib.postgres.fields import ArrayField | ||
| from django.db import models | ||
|
|
||
|
|
||
| class Jobs(models.Model): | ||
| title = models.CharField(max_length=255) | ||
| description = models.TextField(default='', blank=True) | ||
| apply_location_url = models.URLField() | ||
| apply_location_mail = models.EmailField() | ||
| profile = models.URLField() | ||
| active = models.BooleanField(help_text='When a job is active.') | ||
| skills = ArrayField(models.CharField(max_length=200), blank=True, default=[]) | ||
| company = models.CharField(max_length=255) | ||
| github_profile = models.CharField(max_length=255, default='') | ||
| expires_date = models.DateTimeField(default=datetime.utcnow()+timedelta(days=30)) | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. W391 blank line at end of file |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <title>Title</title> | ||
| </head> | ||
| <body> | ||
| <ul> | ||
| {% for job in jobs %} | ||
| <li>{{job.title}}</li> | ||
| {% endfor %} | ||
| </body> | ||
| </html> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| from django.test import TestCase | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. F401 'django.test.TestCase' imported but unused |
||
|
|
||
| # Create your tests here. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| from django.urls import path | ||
|
|
||
| from jobs.apps import JobsConfig | ||
| from jobs.views import list_jobs | ||
|
|
||
| app_name = JobsConfig.name | ||
|
|
||
| urlpatterns = [ | ||
| path('', list_jobs, name='jobs_list') | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| from django.shortcuts import render | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. F401 'django.shortcuts.render' imported but unused |
||
|
|
||
| # Create your views here. | ||
| from django.template.response import TemplateResponse | ||
|
|
||
| from jobs.models import Jobs | ||
|
|
||
|
|
||
| def list_jobs(request): | ||
| context = {'jobs': Jobs.objects.all()} | ||
|
|
||
| return TemplateResponse(request, 'jobs/list.html', context=context) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
F401 'django.contrib.admin' imported but unused