コード例 #1
0
ファイル: base.py プロジェクト: EventBuck/EventBuck
 def getRequiredPostedData(self):
     """
     This function helps to clean and prepare all posted data related to event.
     This is a global check function for posted data
     
     return a dict of all the edited values
     """
     
         
     listOfNamesOfDataToClean = ['name', 'description', 'venue_addresse', 'venue_name', 'geo_location', 'date_event', 'terms', 'category', 'url', 'is_facebook', 'image_url']  # list of editable property
         
     
         
     cleanedData = self.cleanPostedData(listOfNamesOfDataToClean)    
   
     if cleanedData.get('geo_location'):
         cleanedData['geo_location'] = helpers.MakeGeoPointFromString(cleanedData['geo_location'])
         logging.info(cleanedData['geo_location'])
     
     if cleanedData.get('date_event'):
         cleanedData['date_event'] = helpers.jquery_datepicker_parser(cleanedData['date_event'])
     
     
     
     return cleanedData
コード例 #2
0
ファイル: base_handler.py プロジェクト: EventBuck/EventBuck
 def getRequiredPostedData(self):
     """
     This function helps to clean and prepare all data related to event.
     This is a global check function for posted data
     
     return a dict of all the edited values
     """
     listOfNamesOfDataToClean = ['category', 'sub_category','description', 'row', 'section', 'price', 'quantity', 'sell_start', 'sell_end']
     
     cleanedData = self.cleanPostedData(listOfNamesOfDataToClean)
     
     if cleanedData.get('price'):   
         cleanedData['price'] = float(cleanedData.get('price'))
     if cleanedData.get('quantity'):
         cleanedData['quantity'] = int(cleanedData.get('quantity'))
     if cleanedData.get('sell_start'):
         cleanedData['sell_start'] = helpers.jquery_datepicker_parser(cleanedData['sell_start'])
     if cleanedData.get('sell_end'):
         cleanedData['sell_end'] = helpers.jquery_datepicker_parser(cleanedData['sell_end'])
         
     return cleanedData