Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hypha
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
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
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
ots
hypha
Commits
bfed64c3
Commit
bfed64c3
authored
5 years ago
by
Todd Dembrey
Committed by
Fredrik Jonsson
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Lint: order and stop weird "as" behaviour
parent
0697b161
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hypha/apply/projects/models.py
+5
-5
5 additions, 5 deletions
hypha/apply/projects/models.py
with
5 additions
and
5 deletions
hypha/apply/projects/models.py
+
5
−
5
View file @
bfed64c3
...
...
@@ -14,16 +14,16 @@ from django.core.exceptions import ValidationError
from
django.core.validators
import
MinValueValidator
from
django.db
import
models
from
django.db.models
import
(
Count
,
Case
,
F
,
Count
,
ExpressionWrapper
,
F
,
Max
,
OuterRef
,
Q
,
Subquery
,
Sum
,
Value
as
V
,
Value
,
When
,
)
from
django.db.models.functions
import
Cast
,
Coalesce
...
...
@@ -182,7 +182,7 @@ class PaymentRequestQueryset(models.QuerySet):
return
self
.
exclude
(
status
=
DECLINED
)
def
total_value
(
self
,
field
):
return
self
.
aggregate
(
total
=
Coalesce
(
Sum
(
field
),
V
(
0
)))[
'
total
'
]
return
self
.
aggregate
(
total
=
Coalesce
(
Sum
(
field
),
V
alue
(
0
)))[
'
total
'
]
def
paid_value
(
self
):
return
self
.
filter
(
status
=
PAID
).
total_value
(
'
paid_value
'
)
...
...
@@ -309,7 +309,7 @@ class ProjectQuerySet(models.QuerySet):
def
with_amount_paid
(
self
):
return
self
.
annotate
(
amount_paid
=
Coalesce
(
Sum
(
'
payment_requests__paid_value
'
),
V
(
0
)),
amount_paid
=
Coalesce
(
Sum
(
'
payment_requests__paid_value
'
),
V
alue
(
0
)),
)
def
with_last_payment
(
self
):
...
...
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