[snowy] Add pinned field to Note model and REST API.



commit c6f7dee0b1ff5f15c53bac5fa78ad00be41dda22
Author: Sandy Armstrong <sanfordarmstrong gmail com>
Date:   Tue May 19 13:11:05 2009 -0700

    Add pinned field to Note model and REST API.
---
 api/handlers.py |    2 ++
 notes/models.py |    1 +
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/api/handlers.py b/api/handlers.py
index 70f5fda..4db191f 100644
--- a/api/handlers.py
+++ b/api/handlers.py
@@ -133,6 +133,7 @@ class NotesHandler(BaseHandler):
                 note.modified = datetime.now()
             if c.has_key('create-date'): note.created = clean_date(c['create-date'])
             if c.has_key('open-on-startup'): note.open_on_startup = (c['open-on-startup'] == True)
+            if c.has_key('pinned'): note.pinned = (c['pinned'] == True)
             if c.has_key('tags'):
                 note.tags.clear()
                 for tag_name in c['tags']:
@@ -181,6 +182,7 @@ def describe_note(note):
         'last-metadata-change-date': local_iso(note.modified),
         'create-date': local_iso(note.created),
         'open-on-startup': note.open_on_startup,
+        'pinned': note.pinned,
         'last-sync-revision': note.last_sync_rev,
         'tags': [t.name for t in note.tags.all()],
     }
diff --git a/notes/models.py b/notes/models.py
index 2276b60..dd005c7 100644
--- a/notes/models.py
+++ b/notes/models.py
@@ -45,6 +45,7 @@ class Note(models.Model):
                                       default=0)
 
     open_on_startup = models.BooleanField(default=False)
+    pinned = models.BooleanField(default=False)
     
     last_sync_rev = models.IntegerField(default=-1)
 



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