I think you want:
db.define_table('Taste',
Field('Name',unique=True),
format = '%(name)s # <<< important
)
db.define_table('Food',
Field('Name',length=128),
Field('Taste','list:reference Taste'),
)
On Thursday, 5 April 2012 08:09:37 UTC-5, BlueShadow wrote:
>
> Hi guys
> Too simplify things: I like to do a database with two tables:
> food(name(string),taste(reference)) and taste(name(string))
> food should take one or more references to taste for example orange is
> sour and sweet.
> I thought the list:references should be the right type. but when I choose
> the type I still only get a drop down menue where I can choose one taste.
> Could someone please help me with this problem.
> do I have to change the view somehow or did I do something entirly wrong?
> db.define_table('Taste',
> Field('Name')
> )
> db.Taste.name.requires=[IS_NOT_EMPTY(),IS_NOT_IN_DB(db,'Taste.Name')]
>
> db.define_table('Food',
> Field('Name',length=128),
> Field('Taste','list:reference db.Taste'),
> #Field('Taste',db.Taste),
>
> )
>
>