Customise Server Function Name + methods

Hi,

What I’m trying to do:

I ist possible to call more mehods over a customise server fucntion in order to reduce the server calls?

What I’ve tried and what’s not working:

Code Sample:

@anvil.server.callable("methods")
def m1():
  a = 10
  return a

def m2():
  b = 20
  return b

Client Side Call
  def __init__(self, **properties):
    # Set Form properties and Data Bindings.
    self.init_components(**properties)
    server = anvil.server.call("methods")
    print(server)


You can certainly do that yourself, by creating a third server function that calls the other two as regular Python functions.

Or, if you don’t mind using more experimental code, Anvil Labs has a feature that does this for you: Serialization module (anvil-labs new feature) - #2 by hugetim

4 Likes

Hi Jay,

apprecciate the fast response and link.
Ok. now is clear how to solve, thank you.
I will go with the Anvil Labs feature.

BR
Gerhard

1 Like