Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
Djangoldp Conversations
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Startin blox
djangoldp-packages
Djangoldp Conversations
Commits
e6cd19b5
Commit
e6cd19b5
authored
Apr 16, 2019
by
Matthieu Fesselier
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'update/remove-urls-py' into 'master'
update: remove urls.py
#4
Closes
#4
See merge request
!6
parents
00d0fc2d
d652d0ba
Pipeline
#3127
passed with stage
in 27 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
12 deletions
+7
-12
djangoldp_conversation/models.py
djangoldp_conversation/models.py
+7
-2
djangoldp_conversation/urls.py
djangoldp_conversation/urls.py
+0
-10
No files found.
djangoldp_conversation/models.py
View file @
e6cd19b5
from
django.db
import
models
from
django.conf
import
settings
from
django.contrib.auth.models
import
User
from
djangoldp.models
import
Model
class
Thread
(
models
.
Model
):
class
Thread
(
Model
):
title
=
models
.
TextField
()
text
=
models
.
TextField
(
null
=
True
)
author_user
=
models
.
ForeignKey
(
settings
.
AUTH_USER_MODEL
)
...
...
@@ -15,12 +16,14 @@ class Thread(models.Model):
)
auto_author
=
'author_user'
ordering
=
[
'-dateCreated'
]
container_path
=
"threads"
nested_fields
=
[
"message_set"
,
"author_user"
]
def
__str__
(
self
):
return
'{}'
.
format
(
self
.
title
)
class
Message
(
models
.
Model
):
class
Message
(
Model
):
dateCreated
=
models
.
DateField
(
auto_now_add
=
True
)
text
=
models
.
TextField
()
thread
=
models
.
ForeignKey
(
"Thread"
,
on_delete
=
models
.
DO_NOTHING
)
...
...
@@ -34,6 +37,8 @@ class Message(models.Model):
)
auto_author
=
'author_user'
ordering
=
[
'dateCreated'
]
container_path
=
"messages"
nested_fields
=
[
"author_user"
]
def
__str__
(
self
):
return
'{}, le {}'
.
format
(
self
.
text
,
self
.
dateCreated
)
\ No newline at end of file
djangoldp_conversation/urls.py
deleted
100644 → 0
View file @
00d0fc2d
"""djangoldp_conversation URL Configuration"""
from
django.conf.urls
import
url
from
.models
import
Message
,
Thread
from
djangoldp.views
import
LDPViewSet
urlpatterns
=
[
url
(
r'^threads/'
,
LDPViewSet
.
urls
(
model
=
Thread
,
nested_fields
=
[
"message_set"
,
"author_user"
])),
url
(
r'^messages/'
,
LDPViewSet
.
urls
(
model
=
Message
,
nested_fields
=
[
"author_user"
])),
]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment