Quote:
Originally Posted by davidfor
I've gone back and forth over exactly how to do this. My original thought was either a template or the current list of columns. But, allowing both is probably the most compatible. Which is the way you are doing it. But, I'm not a fan of adding what is effectively a special column name. I would normally add a checkbox to enable the feature and that would be enough.
|
I too have been fretting about this.
One problem with that is the interplay between the contents of the columns box and metadata management. If you use a checkbox then can I also use the columns box? What if I don't, making the columns box empty, which in the current code would prevent get_collections() from being called. Is using the checkbox equivalent to having "something" in the columns box? It also raises the question "What does the template return?" Is it a list of columns or a list of items?
Finally, how does one solve the problem of two users wanting different metadata management settings? That could be done with a checkbox and yet another template that returns the management setting desired for the connected device. I have been tempted to play with this, but as I don't need it I haven't taken the time.
The "special name" is safe because it can't conflict with a custom column. It could be made safer by using something like "%template" instead of "template".
But you know all the above.
Quote:
Can I get a copy of your code? That should save me some time, at least for a quick test to make sure I have understood what you are doing.
|
Attached is a zip containing a) complete source files for books.py, driver.py, and kobotouch_config.py; and b) a patch file for the same changes.
The source files incorporate all your changes that have been checked in by Kovid.