-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Evaluate x-viur-bonelist
on default viewSkel()
#1384
base: main
Are you sure you want to change the base?
Conversation
src/viur/core/prototypes/list.py
Outdated
@@ -37,7 +37,7 @@ def viewSkel(self, *args, **kwargs) -> SkeletonInstance: | |||
:return: Returns a Skeleton instance for viewing an entry. | |||
""" | |||
return self.baseSkel(*args, **kwargs) | |||
return self.skel(bones_from_request=True, **kwargs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*args
get lostbones_from_request
cannot be controlled by callingviewSkel()
? --> Please add inviewSkel
s signature and pass it.def viewSkel(self, *args, bones_from_request : bool=True, **kwargs) -> SkeletonInstance:
return self.skel(bones_from_request=True, **kwargs) | |
return self.skel(*args, **kwargs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*args
get lost
I want to get rid of this. It is a relic from days gone by and should be eliminated. To do it, we have to refactor all *Skel()-related stuff in prototypes, and it will also become a breaking change. Therefore, just throw it away for now here.
bones_from_request
cannot be controlled by callingviewSkel()
? --> Please add inviewSkel
s signature and pass it.
We can do it this, do you want it to overwrite this as a default behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now we have a header that controls a bonelist. The header is evaluated by default for all viewSkels.
But what happens if I load another skeleton within the same request? Then the same bonelist is also used for the other skel. You don't want that ...
Furthermore, the Vary header should be set in the response after (and if) the bonelist has been evaluated and applied.
- Introduces generic `SkelModule.skel()` function to obtain a skeleton instance. - Modifies all prototypes to accept `bones_from_request` Replacement for viur-framework#1376
7ec55ae
to
32399e2
Compare
- faces some review issues of @sveneberth - no satisfying integration with existing code
SkelModule.skel()
function to obtain a skeleton instance.bones_from_request
Replacement for #1376