[snowy] Support hiding note and notebook template notes
- From: Jeff Schroeder <jschroeder src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [snowy] Support hiding note and notebook template notes
- Date: Tue, 18 Jan 2011 03:20:20 +0000 (UTC)
commit 7f0ab829f677a5d91d5b24dc6181a2519e25a934
Author: Jeff Schroeder <jeffschroeder computer org>
Date: Sun Dec 26 16:36:44 2010 -0800
Support hiding note and notebook template notes
notes/managers.py | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/notes/managers.py b/notes/managers.py
index b41ce66..f7847bb 100644
--- a/notes/managers.py
+++ b/notes/managers.py
@@ -18,9 +18,11 @@
from django.db import models
class NoteManager(models.Manager):
- def user_viewable(self, request_user, author):
+ def user_viewable(self, request_user, author, templates=False):
notes = self.filter(author=author)
if request_user != author:
# Public notes only
- notes = notes.filter(permissions=1)
+ notes = notes.filter(permissions=1)
+ if not templates:
+ notes = notes.exclude(tags__name="system:template")
return notes
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]