Skip to content

Commit

Permalink
Add admin view for artifacts lineage
Browse files Browse the repository at this point in the history
  • Loading branch information
polyaxon-ci committed Nov 27, 2024
1 parent f1d4930 commit 867e29b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
15 changes: 15 additions & 0 deletions haupt/haupt/db/administration/artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,18 @@ class ArtifactAdmin(DiffModelAdmin):
)
readonly_fields = DiffModelAdmin.readonly_fields + ("name",)
fields = ("name", "kind", "created_at", "updated_at")


class ArtifactLineageAdmin(DiffModelAdmin):
list_display = (
"artifact",
"run",
"is_input",
)
list_display_links = (
"artifact",
"run",
"is_input",
)
readonly_fields = DiffModelAdmin.readonly_fields + ("artifact", "run")
fields = ("artifact", "run", "is_input", "created_at", "updated_at")
3 changes: 2 additions & 1 deletion haupt/haupt/db/administration/register.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
from django.contrib.admin import site
from django.contrib.auth.admin import UserAdmin

from haupt.db.administration.artifacts import ArtifactAdmin
from haupt.db.administration.artifacts import ArtifactAdmin, ArtifactLineageAdmin
from haupt.db.administration.projects import ProjectAdmin
from haupt.db.administration.runs import RunLightAdmin
from haupt.db.defs import Models

site.register(Models.User, UserAdmin)
site.register(Models.Artifact, ArtifactAdmin)
site.register(Models.ArtifactLineage, ArtifactLineageAdmin)
site.register(Models.Project, ProjectAdmin)
site.register(Models.Run, RunLightAdmin)

0 comments on commit 867e29b

Please sign in to comment.