I have a table in which users can insert/update css declarations to
customize a page's styling. Some sample records:

declaration_id                    1
declaration.company_id     263
declaration_selector           body
declaration_property           background-color
declaration.value                 #C0D785

declaration_id                    1
declaration.company_id     263
declaration.selector           body
declaration.property           color
declaration.value                 #008AC9

declaration_id                    1
declaration.company_id     263
declaration.selector           body
declaration.property           font-family
declaration.value                Verdana,Geneva,Arial,Helvetica,Sans-
Serif

declaration_id                    1
declaration.company_id     263
declaration.selector           #header
declaration.property           background-color
declaration.value                 #C0D785

declaration_id                    1
declaration.company_id     263
declaration.selector           #header
declaration.property           color
declaration.value                #0088C7


In the cms I would like the user to be able to insert/update the
declarations per selector (resulting in forms with one, two or three
fields). From what I understand crud.create and crud.update don't
support this kind of behaviour. I thought of building a custom form
using SQLFORM.factory, however, I have no idea of how to pre-populate
the fields in case of updates. I hope one of you does.

Furthermore, I hope one of you could provide me with a simpler
solutions.


Kind regards,

Annet.

Reply via email to