The first is an option. But thinking of other models, like questions
and the best answer, will still be a problem.
I thought of a validator, that will go something like this:

db.define_table('story',
    Field('title'),
    Field('description', 'text'),
)
db.define_table('chapter',
    Field('title'),
    Field('tale', 'text'),
    Field('story_id',db.story)
    Field('is_first_chapter','boolean', default=false)
)
db.chapter.is_first_chapter.requires =
IS_ONLY_ONE_IN_GROUP(group='story_id',only_one_value=true,others_value=false);

I'll try and write this validator sometime this weekend, and see how
it goes.
On Apr 6, 11:36 pm, pbreit <pbreitenb...@gmail.com> wrote:
> Or I could see keeping track of which chapter_number a chapter is in the
> chapter table (do chapters only belong to one book?).

Reply via email to