The ipv6.work project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
577 B

from django.urls import reverse_lazy
from django.views.generic import (
TemplateView, ListView, CreateView
)
from .models import Job
from .forms import JobForm
class Index(TemplateView):
template_name = 'jobs/index.html'
class JobList(ListView):
context_object_name = 'jobs'
model = Job
class JobCreate(CreateView):
model = Job
form_class = JobForm
success_url = reverse_lazy("jobs:list")
def form_valid(self, form):
obj = form.save(commit=False)
obj.posted_by = self.request.user
return super().form_valid(form)