Ejemplo n.º 1
0
 def __init__(self, config):
     '''
     Initialise the RESTModel and add some methods to it.
     '''
     NestedModel.__init__(self, config)
     self.methods = {
         'GET': {
             'foo': {
                 'default': {
                     'default_data': 1234,
                     'call': self.foo,
                     'version': 1,
                     'args': ['message'],
                     'expires': 3600,
                     'validation': []
                 },
                 'ping': {
                     'default_data': 1234,
                     'call': self.ping,
                     'version': 1,
                     'args': [],
                     'expires': 3600,
                     'validation': []
                 }
             }
         }
     }
Ejemplo n.º 2
0
 def __init__(self, config):
     '''
     Initialise the RESTModel and add some methods to it.
     '''
     NestedModel.__init__(self, config)
     # Import the GET methods
     get = Get(config)
     self.methods['GET'] = get.methods['GET']
     
Ejemplo n.º 3
0
 def __init__(self, config):
     '''
     Initialise the RESTModel and add some methods to it.
     '''
     NestedModel.__init__(self, config)
     self.methods = {'GET':{
                        'foo': {
                                 'default':{'default_data':1234,
                                            'call':self.foo,
                                            'version': 1,
                                            'args': ['message'],
                                            'expires': 3600,
                                            'validation': []},
                                 'ping':{'default_data':1234,
                                        'call':self.ping,
                                        'version': 1,
                                        'args': [],
                                        'expires': 3600,
                                        'validation': []}}
                        }
                 }
Ejemplo n.º 4
0
 def __init__(self, config):
     '''
     Initialise the RESTModel and add some methods to it.
     '''
     NestedModel.__init__(self, config)
     
     validator = Validator({'dbi':self.dbi})
     
     self.methods = {'GET':{
                            'list': {
                                     'default':{'default_data':1234, 
                                                'call':self.info,
                                                'version': 1,
                                                'args': ['username'],
                                                'expires': 3600,
                                                'validation': []},
                                     'dn':{'default_data':1234, 
                                            'call':self.dnUserName,
                                            'version': 1,
                                            'args': ['dn'],
                                            'expires': 3600,
                                            'validation': []},
                                     'roles':{'default_data':1234, 
                                            'call':self.roles,
                                            'version': 1,
                                            'args': ['username'],
                                            'expires': 3600,
                                            'validation': []},
                                     'groups':{'default_data':1234, 
                                            'call':self.groups,
                                            'version': 1,
                                            'args': ['username'],
                                            'expires': 3600,
                                            'validation': []}}
                            }
     }