djextdirect¶
Ext.Direct is an RPC framework included in ExtJS. It is being used by Mumble-Django for communications between the web site and the server.
Provider¶
FormProvider¶
Client¶
-
class
djextdirect.client.
Client
(apiurl, apiname='Ext.app.REMOTING_API', cookie=None)¶ Ext.Direct client side implementation.
This class handles parsing an API specification, building proxy objects from it, and making calls to the router specified in the API.
Instantiation:
>>> cli = Client( "http://localhost:8000/mumble/api/api.js", "Ext.app.REMOTING_API" )
The apiname parameter defaults to
Ext.app.REMOTING_API
and is used to select the proper API variable from the API source.The client will then create proxy objects for each action defined in the URL, which are accessible as properties of the Client instance. Suppose your API defines the
Accounts
andMumble
actions, then the client will provide those as such:>>> cli.Accounts <client.AccountsPrx object at 0x93d9e2c> >>> cli.Mumble <client.MumblePrx object at 0x93d9a2c>
These objects provide native Python methods for each method defined in the actions:
>>> cli.Accounts.login <bound method AccountsPrx.login of <client.AccountsPrx object at 0x93d9e2c>>
So, in order to make a call over Ext.Direct, you would simply call the proxy method:
>>> cli.Accounts.login( "svedrin", "passwort" ) {'success': True}
-
call
(action, method, *args)¶ Make a call to Ext.Direct.
-
get_object
(action)¶ Return a proxy object that has methods defined in the API.
-
property
tid
¶ Thread-safely get a new TID.
-