Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1#!/usr/local/bin/python 

2# encoding: utf-8 

3""" 

4*The data model module for the `xmatches_element_views_put` resource* 

5 

6:Author: 

7 David Young 

8""" 

9from builtins import object 

10import sys 

11import os 

12import khufu 

13 

14class models_xmatches_element_views_put(object): 

15 """ 

16 The worker class for the models_xmatches_element_views_put module 

17 

18 **Key Arguments** 

19 

20 - ``log`` -- logger 

21 - ``request`` -- the pyramid request 

22 - ``elementId`` -- the specific element id requests (or False) 

23 - ``search`` -- is this a search request (boolean) 

24  

25 """ 

26 

27 def __init__( 

28 self, 

29 log, 

30 request, 

31 elementId=False, 

32 search=False 

33 ): 

34 self.log = log 

35 self.request = request 

36 self.elementId = elementId 

37 self.search = search 

38 self.qs = dict(request.params) # the query string 

39 # the query string defaults 

40 self.defaultQs = {} 

41 # xt-self-arg-tmpx 

42 

43 log.debug( 

44 "instansiating a new 'models_xmatches_element_views_put' object") 

45 

46 # Variable Data Atrributes 

47 

48 self._set_default_parameters() 

49 

50 return None 

51 

52 def put(self): 

53 """execute the put method on the models_xmatches_element_views_put object 

54 

55 **Return** 

56 

57 - ``responseContent`` -- the reponse to send to the browser 

58  

59 """ 

60 self.log.debug('starting the ``put`` method') 

61 

62 elementId = self.elementId 

63 

64 responseContent = "Response from <code>" + __name__ + "</code><BR><BR>" 

65 if elementId: 

66 responseContent = "%(responseContent)sThe element selected was </code>%(elementId)s</code>" % locals( 

67 ) 

68 else: 

69 responseContent = "%(responseContent)sResource Context selected (no element)" % locals( 

70 ) 

71 

72 self.log.debug('completed the ``put`` method') 

73 return responseContent 

74 

75 def _set_default_parameters( 

76 self): 

77 """ set default parameters 

78 """ 

79 self.log.debug('starting the ``_set_default_parameters`` method') 

80 

81 for k, v in list(self.defaultQs.items()): 

82 if k not in self.qs: 

83 self.qs[k] = v 

84 

85 self.log.debug('completed the ``_set_default_parameters`` method') 

86 return None 

87 

88 # xt-class-method