![]() |
#1021 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,211
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
|
Hi, @chaley.
The has_note(field_name, field_value) function can find all the books that have a note for 'field_name' which value is 'field_value'. Would it be possible to update the function so we can find books that have notes, no matter their value? Maybe setting 'field_value' to '', '*' or something like that. |
![]() |
![]() |
![]() |
#1022 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Note that field_value is for example the tag, author, or series name, not the contents of the note attached to the field. |
|
![]() |
![]() |
Advert | |
|
![]() |
#1023 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,211
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
|
Quote:
|
|
![]() |
![]() |
![]() |
#1024 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 893
Karma: 810834
Join Date: Sep 2017
Location: Buenos Aires, Argentina
Device: moon+ reader, kindle paperwhite
|
Quote:
https://www.mobileread.com/forums/sh...1&postcount=24 |
|
![]() |
![]() |
![]() |
#1025 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Code:
not search:"=author has notes" |
|
![]() |
![]() |
Advert | |
|
![]() |
#1026 | |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,722
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
I have the shortcut Ctrl+Shift+C set to Manage categories, and the 'white N in a red circle' is my <config>/resources/images/note.png image. BR |
|
![]() |
![]() |
![]() |
#1027 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,211
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
|
Quote:
|
|
![]() |
![]() |
![]() |
#1028 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,211
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
|
Quote:
Also, when I click in the Notes header, I get this error: Spoiler:
|
|
![]() |
![]() |
![]() |
#1029 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
This is a regression introduced by adding the counts column to Manage Authors. I submitted a fix. |
|
![]() |
![]() |
![]() |
#1030 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,211
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
|
Quote:
Thank you. |
|
![]() |
![]() |
![]() |
#1031 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Yes. That template returns True ('1') if any author for the book has a note. Using "not" with this will return True if no author has a note. I think this is the wrong answer if a book has (for example) two authors where one author has a note and the other doesn't.
|
![]() |
![]() |
![]() |
#1032 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
|
![]() |
![]() |
![]() |
#1033 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Code:
python: def evaluate(book, context): field_name = context.arguments[0] if context.arguments is not None and len(context.arguments) == 1 else None if field_name is None: raise NameError("The argument for the field name wasn't provided") db = context.db.new_api items_with_notes = context.globals.get('items_with_notes') if items_with_notes is None: items_with_notes = db.get_all_items_that_have_notes(field_name) context.globals['items_with_notes'] = items_with_notes context.globals['item_name_map'] = db.get_item_name_map(field_name) item_name_map = context.globals['item_name_map'] vals = book.get(field_name) if vals is None: return '' if isinstance(vals, str): vals = tuple((vals,)) for val in vals: if item_name_map.get(val) not in items_with_notes: return '' return '1' I stored it with the name "all_items_have_notes". I understand that you want to know if any author for a book doesn't have a note. In this case you would use Code:
not template:"""program: all_items_have_notes('authors')#@#:b:yes"""
|
|
![]() |
![]() |
![]() |
#1034 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,211
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
|
Thank you very much!
|
![]() |
![]() |
![]() |
#1035 | ||
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,722
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
The only reason I can imagine one would want to select multiple authors in Manage authors would be to attach the same note (or link) to multiple authors, but a subsequent change or delete to the note (or link) in one author would not ripple through to other authors. Quote:
BR Last edited by BetterRed; 10-28-2024 at 05:45 PM. |
||
![]() |
![]() |
![]() |
Tags |
custom column, tag, tags |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
custom column i need a little help | shinken | Calibre | 3 | 09-15-2010 03:41 AM |
Using Custom Metadata in Save Template | EJvdH | Calibre | 1 | 07-02-2010 06:06 AM |
Accessories Decalgirl Kindle 2 custom skin template | srmalloy | Amazon Kindle | 6 | 04-09-2010 09:55 PM |
Donations for Custom Recipes | ddavtian | Calibre | 5 | 01-23-2010 04:54 PM |
Help understanding custom recipes | andersent | Calibre | 0 | 12-17-2009 02:37 PM |