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
2d837420
Commit
2d837420
authored
2 years ago
by
Jean-Sébastien Caux
Browse files
Options
Downloads
Patches
Plain Diff
Add PeriodicReport model
parent
98167413
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
scipost_django/finances/admin.py
+12
-1
12 additions, 1 deletion
scipost_django/finances/admin.py
scipost_django/finances/models.py
+32
-0
32 additions, 0 deletions
scipost_django/finances/models.py
with
44 additions
and
1 deletion
scipost_django/finances/admin.py
+
12
−
1
View file @
2d837420
...
...
@@ -4,7 +4,13 @@ __license__ = "AGPL v3"
from
django.contrib
import
admin
from
.models
import
Subsidy
,
SubsidyAttachment
,
WorkLog
from
.models
import
(
Subsidy
,
SubsidyAttachment
,
WorkLog
,
PeriodicReportType
,
PeriodicReport
,
)
class
SubsidyAttachmentInline
(
admin
.
TabularInline
):
...
...
@@ -34,3 +40,8 @@ class WorkLogAdmin(admin.ModelAdmin):
admin
.
site
.
register
(
WorkLog
,
WorkLogAdmin
)
admin
.
site
.
register
(
PeriodicReportType
)
admin
.
site
.
register
(
PeriodicReport
)
This diff is collapsed.
Click to expand it.
scipost_django/finances/models.py
+
32
−
0
View file @
2d837420
...
...
@@ -199,3 +199,35 @@ class WorkLog(models.Model):
@property
def
slug
(
self
):
return
id_to_slug
(
self
.
id
)
####################
# Periodic Reports #
####################
class
PeriodicReportType
(
models
.
Model
):
name
=
models
.
CharField
(
max_length
=
256
)
description
=
models
.
TextField
()
def
__str__
(
self
):
return
self
.
name
class
PeriodicReport
(
models
.
Model
):
"""
Any form of report (annual, financial, administrative etc).
"""
_type
=
models
.
ForeignKey
(
'
finances.PeriodicReportType
'
,
on_delete
=
models
.
CASCADE
,
)
_file
=
models
.
FileField
(
upload_to
=
"
uploads/periodic_reports/%Y/
"
,
max_length
=
256
,
)
created_on
=
models
.
DateTimeField
()
year
=
models
.
PositiveSmallIntegerField
()
def
__str__
(
self
):
return
f
"
{
self
.
year
}
{
self
.
get__type_display
()
}
"
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