← Back to team overview

ladon-dev-team team mailing list archive

Re: [Question #269695]: Use **kwargs in class constructor


Question #269695 on ladon changed:

    Status: Open => Answered

jsgaarde proposed the following answer:
Service class instances are created before any request hit methods. And
only one instance of each service is created on each process. Therefore
it's not possible to pass the wsgi environment to a service class
constructor. I recommend that you create a non-ladonized method in your
class which you call at the beginning of your service methods to pass
your enviromnent. If the environment parsing you need to do is the same
for all service classes and methods I recommend that you implement a
global function or decorator in a separate module.

Best regards
Jakob Simon-Gaarde

You received this question notification because you are a member of
Ladon Developer, which is an answer contact for ladon.