Exemplo n.º 1
0
    def delete_channel(cls, channel_id=None):
        if channel_id is None:
            return None
        users = session.query(UserChannel).filter_by(channel_id=channel_id).all()

        for item in users:
            session.delete(item)

        session.commit()
Exemplo n.º 2
0
    def delete(self, idx: int):
        """Removes reminder from the database"""
        reminder = session.query(Reminder).filter_by(idx=idx).one_or_none()
        if not reminder:
            removed = None
        else:
            session.delete(reminder)
            removed = reminder

        session.commit()

        return removed
Exemplo n.º 3
0
    def delete(self, idx: int):
        """Removes unverify from the database"""
        unverify = session.query(Unverify).filter_by(idx=idx).one_or_none()
        if not unverify:
            removed = None
        else:
            session.delete(unverify)
            removed = unverify

        session.commit()

        return removed