Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
djangoldp
Manage
Activity
Members
Labels
Plan
Issues
99
Issue boards
Milestones
Wiki
Code
Merge requests
5
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
djangoldp-packages
djangoldp
Merge requests
!76
Resolve "Object of type 'Action' is not JSON serializable"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "Object of type 'Action' is not JSON serializable"
148-filtered-fields
into
master
Overview
4
Commits
1
Pipelines
1
Changes
5
Merged
Ghost User
requested to merge
148-filtered-fields
into
master
5 years ago
Overview
4
Commits
1
Pipelines
1
Changes
5
Expand
Closes
#148 (closed)
Edited
5 years ago
by
Ghost User
👍
0
👎
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
b51fd3f6
1 commit,
5 years ago
5 files
+
70
−
9
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
5
Search (e.g. *.vue) (Ctrl+P)
djangoldp/tests/models.py
+
11
−
1
Options
from
django.conf
import
settings
from
django.contrib.auth
import
get_user_model
from
django.db
import
models
from
django.utils.datetime_safe
import
date
from
djangoldp.models
import
Model
from
djangoldp.permissions
import
AnonymousReadOnly
@@ -10,9 +11,13 @@ class Skill(Model):
title
=
models
.
CharField
(
max_length
=
255
,
blank
=
True
,
null
=
True
)
obligatoire
=
models
.
CharField
(
max_length
=
255
)
slug
=
models
.
SlugField
(
blank
=
True
,
null
=
True
,
unique
=
True
)
date
=
models
.
DateTimeField
(
auto_now_add
=
True
,
blank
=
True
)
def
recent_jobs
(
self
):
return
self
.
joboffer_set
.
filter
(
date__gte
=
date
.
today
())
class
Meta
:
serializer_fields
=
[
"
@id
"
,
"
title
"
]
serializer_fields
=
[
"
@id
"
,
"
title
"
,
"
recent_jobs
"
]
lookup_field
=
'
slug
'
@@ -20,9 +25,14 @@ class JobOffer(Model):
title
=
models
.
CharField
(
max_length
=
255
,
blank
=
True
,
null
=
True
)
skills
=
models
.
ManyToManyField
(
Skill
,
blank
=
True
)
slug
=
models
.
SlugField
(
blank
=
True
,
null
=
True
,
unique
=
True
)
date
=
models
.
DateTimeField
(
auto_now_add
=
True
,
blank
=
True
)
def
recent_skills
(
self
):
return
self
.
skills
.
filter
(
date__gte
=
date
.
today
())
class
Meta
:
nested_fields
=
[
"
skills
"
]
serializer_fields
=
[
"
@id
"
,
"
title
"
,
"
skills
"
,
"
recent_skills
"
]
container_path
=
"
job-offers/
"
lookup_field
=
'
slug
'
Loading