Skip to content

Commit

Permalink
views: use a single view again for root factory and resources
Browse files Browse the repository at this point in the history
The data structure is the same again
  • Loading branch information
robvdl committed Mar 13, 2024
1 parent 300b0de commit e275e77
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/sambal/views/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,8 @@
from sambal.resources import Resource, RootFactory


@view_config(context=RootFactory, permission="read", renderer="json")
def root_view(context, request):
"""View for the root node (RootFactory)."""
return {field: resource for field, resource in context.items()}


@view_config(context=Resource, permission="read", renderer="json")
@view_config(context=RootFactory, permission="read", renderer="json")
def resource_view(context, request):
"""Temporary view to produce JSON for every node.
Expand Down

0 comments on commit e275e77

Please sign in to comment.