SciPost Code Repository
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SciPost
Manage
Activity
Members
Labels
Plan
Issues
118
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
SciPost
SciPost
Commits
7c2fc7b3
Commit
7c2fc7b3
authored
8 years ago
by
Geert Kapteijns
Browse files
Options
Downloads
Patches
Plain Diff
Subclass Comment from TimeStampedModel
parent
6ebb224a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
comments/migrations/0006_auto_20170115_1750.py
+27
-0
27 additions, 0 deletions
comments/migrations/0006_auto_20170115_1750.py
comments/models.py
+3
-3
3 additions, 3 deletions
comments/models.py
with
30 additions
and
3 deletions
comments/migrations/0006_auto_20170115_1750.py
0 → 100644
+
27
−
0
View file @
7c2fc7b3
# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2017-01-15 16:50
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
import
django.utils.timezone
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'
comments
'
,
'
0005_merge_20161219_2126
'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'
comment
'
,
name
=
'
created
'
,
field
=
models
.
DateTimeField
(
auto_now_add
=
True
,
default
=
django
.
utils
.
timezone
.
now
),
preserve_default
=
False
,
),
migrations
.
AddField
(
model_name
=
'
comment
'
,
name
=
'
latest_activity
'
,
field
=
models
.
DateTimeField
(
auto_now
=
True
),
),
]
This diff is collapsed.
Click to expand it.
comments/models.py
+
3
−
3
View file @
7c2fc7b3
...
...
@@ -8,7 +8,7 @@ from django.utils.safestring import mark_safe
from
.models
import
*
from
commentaries.models
import
Commentary
from
scipost.models
import
Contributor
from
scipost.models
import
TimeStampedModel
,
Contributor
from
submissions.models
import
Submission
,
Report
from
theses.models
import
ThesisLink
...
...
@@ -34,7 +34,7 @@ COMMENT_STATUS = (
comment_status_dict
=
dict
(
COMMENT_STATUS
)
class
Comment
(
models
.
Model
):
class
Comment
(
TimeStamped
Model
):
"""
A Comment is an unsollicited note, submitted by a Contributor,
on a particular publication or in reply to an earlier Comment.
"""
...
...
@@ -42,7 +42,7 @@ class Comment(models.Model):
vetted_by
=
models
.
ForeignKey
(
Contributor
,
blank
=
True
,
null
=
True
,
on_delete
=
models
.
CASCADE
,
related_name
=
'
comment_vetted_by
'
)
# a Comment is either for a Commentary or Submission
# a Comment is either for a Commentary or Submission
or a ThesisLink.
commentary
=
models
.
ForeignKey
(
Commentary
,
blank
=
True
,
null
=
True
,
on_delete
=
models
.
CASCADE
)
submission
=
models
.
ForeignKey
(
Submission
,
blank
=
True
,
null
=
True
,
on_delete
=
models
.
CASCADE
)
thesislink
=
models
.
ForeignKey
(
ThesisLink
,
blank
=
True
,
null
=
True
,
on_delete
=
models
.
CASCADE
)
...
...
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