def do_DELETE(self):
        self._set_headers(204)

        (resource, id) = self.parse_url(self.path)
        if resource == "entries":
            delete_entry(id)
        self.wfile.write("".encode())
    def do_DELETE(self):
        self._set_headers(204)

        (resource, id) = self.parse_url(self.path)

        # Delete a single animal from the list
        if resource == "entries":
            delete_entry(id)

        self.wfile.write("".encode())
    def do_DELETE(self):
        self._set_headers(204)

        (resource, id) = self.parse_url(self.path)

        # Delete single entry and mood from the list
        if resource == "entries":
            delete_entry(id)
        elif resource == "moods":
            delete_mood(id)

        self.wfile.write("".encode())
    def do_DELETE(self):
        # Set a 204 response code
        self._set_headers(204)

        # Parse the URL
        (resource, id) = self.parse_url(self.path)

        #     # Delete a single entry from the list
        if resource == "entries":
            delete_entry(id)

        self.wfile.write("".encode())
Esempio n. 5
0
    def do_DELETE(self):
        # Set a 204 response code (Processed but no information to send back)
        self._set_headers(204)

        (resource, id) = self.parse_url(self.path)

        if resource == "entries":
            delete_entry(id)

        # if resource == "locations":
        #     delete_location(id)

        self.wfile.write("".encode())
Esempio n. 6
0
    def do_DELETE(self):
        # Set a 204 response code
        self._set_headers(204)

        # Parse the URL
        (resource, id) = self.parse_url(self.path)

        # Delete a single animal and send in response
        if resource == "entries":
            delete_entry(id)

        # Encode the new item and send in response
        self.wfile.write("".encode())
Esempio n. 7
0
    def strike_from_history(self):
        """
        Delete the last item from the history list, then remove it from said
        list.
        """

        entry, pagenum = self.history[-1]
        eid = entries.get_eid(entry)
        database.cursor.execute('DELETE FROM occurrences WHERE eid = ?'
                                   'AND page = ?', (eid, pagenum))
        if not entries.fetch_occurrences(eid): # no other occurrences
            entries.delete_entry(eid)

        self.history.pop()
Esempio n. 8
0
    def do_DELETE(self):
        # Set a 204 response code
        self._set_headers(204)

        # Parse the URL
        (resource, id) = self.parse_url(self.path)

        # Delete a single entry from the list
        if resource == "entries":
            delete_entry(id)
            # Encode the new entry and send in response

        # if resource == "customers":
        #     delete_customer(id)
        #     # Encode the new customer and send in response
        #     self.wfile.write("".encode())

        self.wfile.write("".encode())
Esempio n. 9
0
def delete_entry(id):
    if not users.authenticated():
        abort(403)
    if entries.delete_entry(id):
        return redirect("/diary")