[silva-dev] Creating a Metadata MultiListField

Samuel Schluep schluep at iha.bepr.ethz.ch
Tue Jul 1 17:17:59 CEST 2003


Dear Martijn

> Yes, ugh, this is an unfortunate development I hope to be able to correct
> at some point in the future. :(

In the meantime I help myself with some easy patch. In Import.py of the
SilvaMetadata-product I changed:

            elif t == 'list':
                # XXX this is incomplete support for lists
                # the originial version of formulator xml support
                # did an eval here, which is not an option
                 v = filter(None, [vi.strip() for vi in v[1:-1].split(',')])

to

            elif t == 'list':
                # XXX this is an ugly patch to support lists with tuples.
                if v.find('('):
                    v = eval(v)
                else:
                    v = filter(None, [vi.strip() for vi in
v[1:-1].split(',')])

In many cases metadata entrys use restricted vocabularies. Here a list with
terms to choose from seems to be the best solution.

Best Regards
Sam




More information about the silva-dev mailing list