[snowy] Handle delete commands.



commit 2f53d71b38ff03b5bdf24b68d848de60563f28c8
Author: Sandy Armstrong <sanfordarmstrong gmail com>
Date:   Sun May 17 23:48:00 2009 -0700

    Handle delete commands.
---
 api/handlers.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/api/handlers.py b/api/handlers.py
index 6ebb6ff..fa0a5f1 100644
--- a/api/handlers.py
+++ b/api/handlers.py
@@ -98,6 +98,9 @@ class NotesHandler(BaseHandler):
         changes = json.loads(request.raw_post_data)['note-changes']
         for c in changes:
             note, created = Note.objects.get_or_create(author=user, guid=c['guid'])
+            if c.has_key('command') and c['command'] == 'delete':
+                note.delete()
+                continue
             if c.has_key('title'): note.title = c['title']
             if c.has_key('note-content'): note.content = c['note-content']
             if c.has_key('last-change-date'): note.user_modified = clean_date(c['last-change-date'])



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]