07-18-2010, 07:59 AM | #16 | |||
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
Quote:
I was trying to figure out if your set_custom worked the same way as set_metadata (has back end that will remove dupes), and would let me do a simple append, or did I need to handle dupes here. Quote:
Also, a part of the question was about differences between get_metadata and get_custom as they related to tag-like text fields. For some reason, I was thinking that because the datatype was set as "text" for simple text fields and for tag-like fields (is_multiple) that all I would be getting for the tag-like data was a single text string, which would include all tag-like entries and their separators. I was thinking I would have to do a split on the separator character to get them into individual tag-like entries in a list, find dupes myself, put them back into a single string with separators and pass that back. I haven't checked yet, but from your post (and thinking about it further) I suspect I'm going to get a list when I do a get_custom for an is_multiple text field, not a string with separator characters in it. I should have done more checking before asking. |
|||
07-18-2010, 08:35 AM | #17 |
Grand Sorcerer
Posts: 11,703
Karma: 6658935
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
You are correct. You get a list, and you must give a list.
|
Advert | |
|
07-18-2010, 11:47 AM | #18 |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Are there any cases where a datatype comments field can have a len(comments) == 0 and comments != False?
I have a test in the non-custom comments field of: Code:
if not dest_mi.comments or len(dest_mi.comments) == 0: |
07-18-2010, 11:55 AM | #19 | ||
Grand Sorcerer
Posts: 11,703
Karma: 6658935
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Quote:
I often use the test 'if str: to test if the string has an 'interesting' value. |
||
07-19-2010, 08:06 AM | #20 |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
New code to handle the User defined fields during merge was uploaded over the weekend.
|
Advert | |
|
07-22-2010, 10:27 AM | #21 |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Losing books/formats is not normal.-Chaley | theducks | Calibre | 7 | 10-02-2010 11:11 AM |
Suggestion: Selecting a user-defined Category should show all of the books in it | Daemon | Calibre | 6 | 08-23-2010 01:19 PM |
Jobs Queue, Merging, Metadata, I think that's it.... | rabidrobot | Calibre | 2 | 08-17-2010 07:31 PM |
User Defined Columns | jjansen | Calibre | 3 | 03-17-2010 05:33 PM |
User Defined Fonts | gr8npwrfl | Ectaco jetBook | 1 | 01-21-2010 08:35 AM |