Partially solved. Manually added field of the reference type now has a drop
down list. The field is defined and set properly before SLQFORM.factory in
this way:
pt = Field('phone_type', 'reference phone_types')
pt.requires=IS_IN_DB(db, db.phone_types.id, '%(type)s')
Then it is used in SQLFORM.factory.
Still I have no concept how to multiply this field according to the phone
number field multiplication.I've tried tu use 'show_if' function but I
really don't know how to point many phone 'number' input objects which are
created runtime.
I'll be grateful for any help or advise.
Przemek
W dniu niedziela, 11 stycznia 2015 22:46:48 UTC+1 użytkownik Przemysław
Loesch napisał:
>
> Massimo, thank you very much for your answer. List type widget works just
> great. I didn't know web2py already has the feature which I tried to
> implement in the complicated way. I'm wondering how many such goodies are
> waiting for me to discover in this great framework.
>
> Now going back to forms. The logic is no problem because I insert data
> myself using additional values - the form contains only some of the fields
> of the whole table. Anyway insert is manual after form validation. The
> 'phones' table is separate from 'institutions' because it contains also
> phone type, description, and reference to a person. This is the reason of
> my next question. Is it possible in some way to multiply a set of fields?
> In my form I actually multiply the whole row of the 'phones' table. The
> thing I cannot achieve so far is the manually added reference field working
> like the one created by SQLFORM with the db.phones.phone_type as an
> argument. Manually added Field('phone_type', 'reference db.phone_type' )
> doesn't have a drop down list with phone types. Is it a way to solve this?
> Thanks a lot!
> Przemek
>
>
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.