Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jean Michel Rouly
research-questions
Commits
204b1bcf
Commit
204b1bcf
authored
Mar 08, 2014
by
Jean Michel Rouly
Browse files
Added a reverse comment->parent relationship
parent
0545077c
Changes
1
Hide whitespace changes
Inline
Side-by-side
researchquestions/website/models.py
View file @
204b1bcf
...
...
@@ -41,7 +41,7 @@ class Comment( models.Model ):
user
=
models
.
ForeignKey
(
User
)
date
=
models
.
DateTimeField
(
default
=
timezone
.
now
())
text
=
models
.
TextField
()
parent
=
models
.
ForeignKey
(
'Question'
)
parent
=
models
.
ForeignKey
(
'Question'
,
related_name
=
'comments'
,
related_query_name
=
'comments'
)
def
get_replies
(
self
):
replies
=
Reply
.
objects
.
filter
(
parent__pk
=
self
.
pk
)
...
...
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