Example #1
0
 def remove_fact(fact_text):
     database = Database()
     database.initialize()
     if database.find_one("facts", {"fact_text": fact_text}) is None:
         raise LookupError('Fact was not found in the database')
     else:
         database.remove("facts", {"fact_text": fact_text})
         print("Fact was successfully removed")
 def remove_distributor(email_address=None, slack_ids=None):
     database = Database()
     database.initialize()
     if database.find_one("distributors", {"email_address": email_address,
                                           "slack_ids": slack_ids}):
         database.remove("distributors", {"email_address": email_address,
                                          "slack_ids": slack_ids})
         return True
Example #3
0
 def remove_user(self):
     database = Database()
     database.initialize()
     database.remove("users", {"_id": self._id})
     print("User successfully removed")
Example #4
0
 def remove_entry(self):
     database = Database()
     database.initialize()
     database.remove("samples", self.json())