alcatel/dataparser/DocumentaryFileAnnotationAttributes.py
changeset 27 8ca7f2cea729
equal deleted inserted replaced
26:94f586daa623 27:8ca7f2cea729
       
     1 '''
       
     2 Created on 10 August 2012
       
     3 
       
     4 @author: Gerard
       
     5 '''
       
     6 import logging
       
     7 
       
     8 logger = logging.getLogger('document')
       
     9 
       
    10 class DocumentaryFileAnnotationCreateAttributes(object):
       
    11 
       
    12     def __init__(self, request):
       
    13         self.request = request
       
    14     
       
    15     def get_user(self):
       
    16         user = ''
       
    17         try:
       
    18             user = self.request.POST['user']
       
    19         except Exception, err:
       
    20             logger.info('No user attribute in the http request.'+str(err))
       
    21         return user
       
    22     
       
    23     def get_documentary_file_id(self):
       
    24         documentary_file_id = ''
       
    25         try:
       
    26             documentary_file_id = self.request.POST['documentary_file_id']
       
    27         except Exception, err:
       
    28             logger.info('No documentary_file_id attribute in the http request. ' + str(err))
       
    29         return documentary_file_id
       
    30     
       
    31     def get_annotation(self):
       
    32         annotation = ''
       
    33         try:
       
    34             annotation = self.request.POST['annotation']
       
    35         except Exception, err:
       
    36             logger.info('No annotation attribute in the http request.' + str(err))
       
    37         return annotation