Skip to content

Commit

Permalink
Add contributors filter
Browse files Browse the repository at this point in the history
  • Loading branch information
polyaxon-ci committed Jun 24, 2024
1 parent 396cdb7 commit cc7ac5c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion haupt/haupt/apis/serializers/project_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def validated_project_artifacts(self, run, artifacts):
return set(f[0] for f in found)

def update(self, instance, validated_data):
kind = validated_data.pop("c" "kind", None)
kind = validated_data.pop("kind", None)
if kind and instance.kind != kind:
raise ValidationError("Changing a version kind is not permitted.")
content = validated_data.get("content")
Expand Down
5 changes: 5 additions & 0 deletions haupt/haupt/db/query_managers/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class ProjectQueryManager(BaseQueryManager):
FIELDS_PROXY = {
"id": "uuid",
"uid": "uuid",
"contributors": "contributors__username",
}
FIELDS_USE_NAME = {
"teams",
Expand Down Expand Up @@ -48,6 +49,8 @@ class ProjectQueryManager(BaseQueryManager):
"live_state": parse_value_operation,
# Teams
"teams": parse_value_operation,
# Contributors
"contributors": parse_value_operation,
}
CONDITIONS_BY_FIELD = {
# Uuid
Expand All @@ -69,4 +72,6 @@ class ProjectQueryManager(BaseQueryManager):
"live_state": ValueCondition,
# Teams
"teams": ValueCondition,
# Contributors
"contributors": ValueCondition,
}
5 changes: 5 additions & 0 deletions haupt/haupt/db/query_managers/project_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class ProjectVersionQueryManager(BaseQueryManager):
"id": "uuid",
"uid": "uuid",
"teams": "project__teams__name",
"contributors": "contributors__username",
}
FIELDS_ORDERING = (
"created_at",
Expand Down Expand Up @@ -59,6 +60,8 @@ class ProjectVersionQueryManager(BaseQueryManager):
"run": parse_value_operation,
# Teams
"teams": parse_value_operation,
# Contributors
"contributors": parse_value_operation,
# Projects
"project": parse_value_operation,
}
Expand Down Expand Up @@ -86,6 +89,8 @@ class ProjectVersionQueryManager(BaseQueryManager):
"run": ValueCondition,
# Teams
"teams": ValueCondition,
# Contributors
"contributors": ValueCondition,
# Projects
"project": ValueCondition,
}
5 changes: 5 additions & 0 deletions haupt/haupt/db/query_managers/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class RunQueryManager(BaseQueryManager):
"downstream": "downstream_runs",
"user": "user__username",
"teams": "project__teams__name",
"contributors": "contributors__username",
}
FIELDS_DISTINCT = {
"artifacts",
Expand Down Expand Up @@ -193,6 +194,8 @@ class RunQueryManager(BaseQueryManager):
"connections": parse_value_operation,
# Teams
"teams": parse_value_operation,
# Contributors
"contributors": parse_value_operation,
# My runs
"mine": parse_value_operation,
}
Expand Down Expand Up @@ -295,6 +298,8 @@ class RunQueryManager(BaseQueryManager):
"connections": ValueCondition,
# Teams
"teams": ValueCondition,
# Contributors
"contributors": ValueCondition,
# My runs
"mine": CallbackCondition(callback_conditions.mine_condition),
}
Expand Down

0 comments on commit cc7ac5c

Please sign in to comment.