View Single Post
Old 12-01-2010, 06:04 AM   #90
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,739
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Sweetpea View Post
Would it be possible to make a custom composite column that limits the text you can add?
Yes, it would be possible to create a text column type that is actually an enumeration. There are, of course, complexities. The biggest is ensuring that all the places that can change the contents respect the enumeration values. This will touch metadata editing, drag & drop, the CLI (I think), and the library GUI.
Quote:
Example: I now use the "tri-state boolean" to keep track of read/to-be-read/reading books. But, I'd like to use the normal boolean for other columns. But I can't have both (or can I?).
Nope. T'is all or nothing.

Thinking about it, you can get a poor-man's enumeration type using a normal and a composite column. The normal column would be used to enter the information. The composite column would use a switch statement to limit the text. For example, if the first column is integer, then the switch would test for 1, 2, etc. If the value is not one of those, it takes the default.
chaley is offline   Reply With Quote