Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
124 changes: 118 additions & 6 deletions docs/api/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6218,6 +6218,52 @@ paths:
name: id__not_isnull
schema:
type: boolean
- in: query
name: pi
schema:
type: string
- in: query
name: pi__contains
schema:
type: string
- in: query
name: pi__endswith
schema:
type: string
- in: query
name: pi__in
schema:
type: array
items:
type: string
description: Multiple values may be separated by commas.
explode: false
style: form
- in: query
name: pi__isnull
schema:
type: boolean
- in: query
name: pi__not_contains
schema:
type: string
- in: query
name: pi__not_in
schema:
type: array
items:
type: string
description: Multiple values may be separated by commas.
explode: false
style: form
- in: query
name: pi__not_isnull
schema:
type: boolean
- in: query
name: pi__startswith
schema:
type: string
- in: query
name: start_date
schema:
Expand Down Expand Up @@ -7534,6 +7580,52 @@ paths:
name: id__not_isnull
schema:
type: boolean
- in: query
name: pi
schema:
type: string
- in: query
name: pi__contains
schema:
type: string
- in: query
name: pi__endswith
schema:
type: string
- in: query
name: pi__in
schema:
type: array
items:
type: string
description: Multiple values may be separated by commas.
explode: false
style: form
- in: query
name: pi__isnull
schema:
type: boolean
- in: query
name: pi__not_contains
schema:
type: string
- in: query
name: pi__not_in
schema:
type: array
items:
type: string
description: Multiple values may be separated by commas.
explode: false
style: form
- in: query
name: pi__not_isnull
schema:
type: boolean
- in: query
name: pi__startswith
schema:
type: string
- in: query
name: start_date
schema:
Expand Down Expand Up @@ -11618,12 +11710,17 @@ components:
agency:
type: string
maxLength: 100
pi:
type: string
nullable: true
maxLength: 100
amount:
type: string
format: decimal
pattern: ^-?\d{0,12}(?:\.\d{0,2})?$
grant_number:
type: string
nullable: true
maxLength: 250
start_date:
type: string
Expand All @@ -11646,6 +11743,7 @@ components:
- end_date
- grant_number
- id
- pi
- start_date
- team
- title
Expand All @@ -11661,13 +11759,17 @@ components:
type: string
minLength: 1
maxLength: 100
pi:
type: string
nullable: true
maxLength: 100
amount:
type: string
format: decimal
pattern: ^-?\d{0,12}(?:\.\d{0,2})?$
grant_number:
type: string
minLength: 1
nullable: true
maxLength: 250
start_date:
type: string
Expand All @@ -11684,7 +11786,6 @@ components:
required:
- agency
- amount
- grant_number
- start_date
- team
- title
Expand Down Expand Up @@ -11746,12 +11847,17 @@ components:
agency:
type: string
maxLength: 100
pi:
type: string
nullable: true
maxLength: 100
amount:
type: string
format: decimal
pattern: ^-?\d{0,12}(?:\.\d{0,2})?$
grant_number:
type: string
nullable: true
maxLength: 250
start_date:
type: string
Expand All @@ -11769,7 +11875,6 @@ components:
required:
- agency
- amount
- grant_number
- id
- start_date
- team
Expand All @@ -11786,13 +11891,17 @@ components:
type: string
minLength: 1
maxLength: 100
pi:
type: string
nullable: true
maxLength: 100
amount:
type: string
format: decimal
pattern: ^-?\d{0,12}(?:\.\d{0,2})?$
grant_number:
type: string
minLength: 1
nullable: true
maxLength: 250
start_date:
type: string
Expand All @@ -11807,7 +11916,6 @@ components:
required:
- agency
- amount
- grant_number
- start_date
- title
JobExecutionError:
Expand Down Expand Up @@ -12633,13 +12741,17 @@ components:
type: string
minLength: 1
maxLength: 100
pi:
type: string
nullable: true
maxLength: 100
amount:
type: string
format: decimal
pattern: ^-?\d{0,12}(?:\.\d{0,2})?$
grant_number:
type: string
minLength: 1
nullable: true
maxLength: 250
start_date:
type: string
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 5.2.14 on 2026-06-08 14:03

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('research_products', '0009_grant_description_alter_grant_end_date_and_more'),
]

operations = [
migrations.AddField(
model_name='grant',
name='pi',
field=models.CharField(blank=True, max_length=100, null=True),
),
migrations.AlterField(
model_name='grant',
name='grant_number',
field=models.CharField(blank=True, max_length=250, null=True),
),
]
3 changes: 2 additions & 1 deletion keystone_api/apps/research_products/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ class Meta:

title = models.CharField(max_length=250)
agency = models.CharField(max_length=100)
pi = models.CharField(max_length=100, null=True, blank=True)
amount = models.DecimalField(decimal_places=2, max_digits=14)
grant_number = models.CharField(max_length=250)
grant_number = models.CharField(max_length=250, null=True, blank=True)
start_date = models.DateField()
end_date = models.DateField(null=True, blank=True)
description = models.TextField(null=True, blank=True)
Expand Down
2 changes: 1 addition & 1 deletion keystone_api/apps/research_products/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class GrantViewSet(TeamScopedListMixin, viewsets.ModelViewSet):
team_field = "team"

permission_classes = [IsAuthenticated, IsAdminUser | IsTeamMember]
search_fields = ["title", "agency", "team__name"]
search_fields = ["title", "agency", "team__name", "pi"]
serializer_class = GrantSerializer
queryset = Grant.objects.prefetch_related(
"history",
Expand Down
Loading