Removes the statement that matches the input text. Removes any responses from statements where the response text matches the input text.
(self, statement_text)
| 149 | session.close() |
| 150 | |
| 151 | def remove(self, statement_text): |
| 152 | """ |
| 153 | Removes the statement that matches the input text. |
| 154 | Removes any responses from statements where the response text matches |
| 155 | the input text. |
| 156 | """ |
| 157 | Statement = self.get_model('statement') |
| 158 | session = self.Session() |
| 159 | try: |
| 160 | query = session.query(Statement).filter_by(text=statement_text) |
| 161 | record = query.first() |
| 162 | |
| 163 | session.delete(record) |
| 164 | session.commit() |
| 165 | finally: |
| 166 | session.close() |
| 167 | |
| 168 | def filter(self, **kwargs): |
| 169 | """ |