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
Commits
5730dde2
Commit
5730dde2
authored
5 years ago
by
Jean-Baptiste
Browse files
Options
Downloads
Patches
Plain Diff
bugfix: catch and ignore ModuleNotFoundError if models.py does not exists on package
parent
5524de39
No related branches found
No related tags found
1 merge request
!55
Resolve "Error when a package has no models"
Pipeline
#890
passed with stage
in 1 minute and 29 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
djangoldp/urls.py
+4
-1
4 additions, 1 deletion
djangoldp/urls.py
djangoldp/views.py
+4
-1
4 additions, 1 deletion
djangoldp/views.py
with
8 additions
and
2 deletions
djangoldp/urls.py
+
4
−
1
View file @
5730dde2
...
...
@@ -20,7 +20,10 @@ urlpatterns = [
]
for
package
in
settings
.
DJANGOLDP_PACKAGES
:
import_module
(
'
{}.models
'
.
format
(
package
))
try
:
import_module
(
'
{}.models
'
.
format
(
package
))
except
ModuleNotFoundError
:
pass
model_classes
=
{
cls
.
__name__
:
cls
for
cls
in
Model
.
__subclasses__
()}
...
...
This diff is collapsed.
Click to expand it.
djangoldp/views.py
+
4
−
1
View file @
5730dde2
...
...
@@ -151,7 +151,10 @@ class LDPViewSet(LDPViewSetGenerator):
class
LDPNestedViewSet
(
LDPViewSet
):
"""
A special case of LDPViewSet serving objects of a relation of a given object (e.g. members of a group, or skills of a user)
"""
"""
A special case of LDPViewSet serving objects of a relation of a given object
(e.g. members of a group, or skills of a user)
"""
parent_model
=
None
parent_lookup_field
=
None
related_field
=
None
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment