After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 612025 - Notebook templates should not appear in sidebar note list
Notebook templates should not appear in sidebar note list
Status: RESOLVED FIXED
Product: snowy
Classification: Deprecated
Component: general
git master
Other Linux
: Normal enhancement
: 1.0 (public beta)
Assigned To: snowy-maint
snowy-maint
Depends on:
Blocks: 613884
 
 
Reported: 2010-03-06 19:31 UTC by Sandy Armstrong
Modified: 2011-01-18 03:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Don't display Note / Notebook Template notes (1.68 KB, patch)
2010-12-27 06:27 UTC, Jeff Schroeder
needs-work Details | Review
Version 2 for hiding note templates (989 bytes, patch)
2011-01-18 02:46 UTC, Jeff Schroeder
committed Details | Review

Description Sandy Armstrong 2010-03-06 19:31:42 UTC
There should be a good way to view/edit notebook template notes, but they should not show up in the list of recent notes (just like with Tomboy's menu).
Comment 1 Benoit Garret 2010-03-27 18:16:03 UTC
If someone wants a quick and dirty way of hiding all these notebook templates clobbering the list, I've pushed a patch at http://github.com/bgarret/snowy.git .

I'd be happy to work on something more elaborate, but it would be quite useless for now as snowy can't edit notes (yet ;-) ).
Comment 2 Sandy Armstrong 2010-04-04 14:26:53 UTC
Just reading the code, this looks good, except that I think the new field should be "is_template", not "is_notebook_template", since there is also a general template note that is not notebook-specific.

I'll need to apply the commits to test out the behavior, though.
Comment 3 Sandy Armstrong 2010-04-10 17:10:49 UTC
So since I'm not familiar with South, to use this patch I had to update my database like so:

sqlite3 snowy.db alter table notes_note add column "is_notebook_template" bool NOT NULL DEFAULT False

Checking in the admin tool, all notes were indeed set with is_notebook_template=False, but when trying to view my notes, none were displayed. I haven't had a chance to dig in and figure out why yet.

As for the other commit that shows which notebook a note belongs to, I'll keep discussion of that in bug #613881.
Comment 4 Benoit Garret 2010-04-11 12:44:18 UTC
The notes not being displayed happens to me as well and I can't figure out why. A workaround is to save all notes using the django console, everything shows up fine afterwards:

benoit@benoit-laptop:~/code/checkouts/snowy.eclipse/snowy$ ./manage.py shell
Python 2.6.5 (r265:79063, Apr  3 2010, 01:57:29) 
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from snowy.notes.models import Note
>>> for note in Note.objects.all():
...     note.save()

I looked into using south to do the migration, but it didn't look trivial as (at least) the autoslug library doesn't support it out of the box.
Comment 5 Jeff Schroeder 2010-12-27 06:27:15 UTC
Created attachment 177084 [details] [review]
Don't display Note / Notebook Template notes

I didn't have any internet on the flight home and remembered this was a bug. Instead of an additional database column, I opted to use Q objects and a slightly more complex query.
Comment 6 Sandy Armstrong 2011-01-16 15:13:34 UTC
Review of attachment 177084 [details] [review]:

::: notes/managers.py
@@ +26,3 @@
+        if not templates:
+            Q = models.Q
+            query = ~Q(title__endswith="Notebook Template") & ~Q(title__exact="New Note Template")

This check is incorrect.  The proper check is to look for the system:template tag.
Comment 7 Jeff Schroeder 2011-01-18 02:46:54 UTC
Created attachment 178577 [details] [review]
Version 2 for hiding note templates

Version 2:
    - exclude notes including the NoteTag system:template in the Note.user_viewable manager
    - make this the default functionality
Comment 8 Sandy Armstrong 2011-01-18 02:52:51 UTC
Review of attachment 178577 [details] [review]:

Cool.