diff --git a/scipost_django/scipost/feeds.py b/scipost_django/scipost/feeds.py index dc8c901a58c460de659c3927c47701c700bb0201..81c01cb35872d84fae03d4a89dcb1a477716fed7 100644 --- a/scipost_django/scipost/feeds.py +++ b/scipost_django/scipost/feeds.py @@ -10,6 +10,7 @@ from django.utils.feedgenerator import Atom1Feed from django.urls import reverse from django.db.models import Q +from careers.models import JobOpening from comments.models import Comment from commentaries.models import Commentary from journals.models import Publication @@ -179,3 +180,22 @@ class LatestPublicationsFeedAtom(LatestPublicationsFeedRSS): return datetime.datetime(item.publication_date.year, item.publication_date.month, item.publication_date.day) + + +class DjangoJobOpeningsFeedRSS(Feed): + title = 'SciPost: Dev Jobs' + link = '/careers/django/' + description = "SciPost: Django dev job openings" + + def items(self): + return JobOpening.objects.publicly_visible().filter( + description__icontains='django') + + def item_title(self, item): + return item.title + + def item_description(self, item): + return item.short_description + + def item_link(self, item): + return item.get_absolute_url() diff --git a/scipost_django/scipost/urls.py b/scipost_django/scipost/urls.py index 3ca680c257bec9881f81286dfc3f6c90d202ce7c..3fa117fb9a5bf8f16d19f9573a138bdd5ee7963d 100644 --- a/scipost_django/scipost/urls.py +++ b/scipost_django/scipost/urls.py @@ -9,9 +9,12 @@ from django.views.generic.base import RedirectView from django.urls import include, path, re_path from . import views, sso -from .feeds import LatestNewsFeedRSS, LatestNewsFeedAtom, LatestCommentsFeedRSS,\ - LatestCommentsFeedAtom, LatestSubmissionsFeedRSS, LatestSubmissionsFeedAtom,\ - LatestPublicationsFeedRSS, LatestPublicationsFeedAtom +from .feeds import ( + LatestNewsFeedRSS, LatestNewsFeedAtom, LatestCommentsFeedRSS, + LatestCommentsFeedAtom, LatestSubmissionsFeedRSS, LatestSubmissionsFeedAtom, + LatestPublicationsFeedRSS, LatestPublicationsFeedAtom, + DjangoJobOpeningsFeedRSS, +) from journals import views as journals_views from journals.regexes import ISSUE_DOI_LABEL_REGEX,\ @@ -282,6 +285,11 @@ urlpatterns = [ LatestPublicationsFeedAtom(), name='feeds_atom_publications' ), + path( + 'rss/careers/django/', + DjangoJobOpeningsFeedRSS(), + name='feeds_django_job_openings' + ), path( 'atom/publications/<specialty:specialty>', LatestPublicationsFeedAtom(),