plone / guillotina

Python AsyncIO data API to manage billions of resources
https://guillotina.readthedocs.io/en/latest/
Other
188 stars 51 forks source link

Remove IRequest from adapters #839

Open vangheem opened 4 years ago

vangheem commented 4 years ago

@bloodbare @masipcat I'd like to remove the dependency on request objects in order to do many adapter lookups on g6. Do you have thoughts/opinions on this?

For example:

masipcat commented 4 years ago

I'm curious: the reason to have requests as part of the adapter is because it was the only way to have the instance to the current request (inside the adapter)? And now that we have the request in the task var isn't needed?

Anyway, I'm ok with your proposal

vangheem commented 4 years ago

The original reason I believe was that you could install an add-on that installed a layer(see guillotina.interfaces.registry.ILayers.active_layers).

This would allow you to register adapters that only applied when your addon was installed.

However, it seems to me that no one uses guillotina for this use-case.

I'd even be inclined to remove it at this point. Thoughts?

masipcat commented 4 years ago

I'd even be inclined to remove it at this point. Thoughts?

IMO it's ok to remove it

bloodbare commented 4 years ago

I understand that that will only be for json schema serialization, you could still do a view with your layer and call your own serializer if you want, isn't it ?

vangheem commented 4 years ago

yes. I'm really okay closing things related to adapter IRequest changes...