Commit 5d06fd5d authored by Jean-Baptiste's avatar Jean-Baptiste

update: use the framework Model and urls

parent 08297756
Pipeline #2813 passed with stage
in 27 seconds
......@@ -3,6 +3,7 @@ from .models import JobOffer
from django.contrib.auth.models import User
from django.db.models.signals import post_save
class JobOfferFactory(factory.django.DjangoModelFactory):
class Meta:
from django.contrib.auth.models import User
from django.db import models
from djangoldp.models import Model
from djangoldp_skill.models import Skill
class JobOffer(models.Model):
class JobOffer(Model):
author = models.ForeignKey(User, on_delete=models.CASCADE)
title = models.CharField(max_length=255, blank=True, null=True)
description = models.CharField(max_length=255, blank=True, null=True)
......@@ -14,10 +15,8 @@ class JobOffer(models.Model):
class Meta:
auto_author = 'author'
permissions = (
('view_joboffer', 'Read'),
('control_joboffer', 'Control'),
nested_fields = ["skills"]
container_path = 'job-offers/'
def __str__(self):
return '{} ({})'.format(self.title,
"""djangoldp joboffer URL Configuration"""
from django.conf.urls import url
from djangoldp.views import LDPViewSet
from .models import JobOffer
urlpatterns = [
url(r'^job-offers/', LDPViewSet.urls(model=JobOffer, nested_fields=["skills"])),
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment