Example #1
0
 def add_categories_to_db(self, event_categories):
     self.get_categories_in_db()
     for category_type in event_categories:
         if category_type not in self.categories_in_db:
             category.insert().values(category=category_type)
     self.get_categories_in_db()
     return self
Example #2
0
 def add_category_to_db(self, category_string):
     ins = category.insert().values(category=category_string)
     return self.connection.execute(ins).inserted_primary_key[0]