Skip to content

Commit

Permalink
feat: Add site owner and project to soil data admin list display
Browse files Browse the repository at this point in the history
  • Loading branch information
knipec committed Jul 26, 2024
1 parent a4bab1a commit efe676e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion terraso_backend/apps/soil_id/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,15 @@ class SoilDataAdmin(admin.ModelAdmin):
def site_name(self, obj):
return obj.site.name

list_display = ("site_name", "depth_interval_preset")
@admin.display(ordering="site__owner")
def site_owner(self, obj):
return obj.site.owner

@admin.display(ordering="site__project__name")
def project(self, obj):
return obj.site.project.name if obj.site.project is not None else None

list_display = ("site_name", "project", "site_owner", "depth_interval_preset")
inlines = [
DepthDependentSoilDataInline,
SoilDataDepthIntervalInline,
Expand Down

0 comments on commit efe676e

Please sign in to comment.