[Cubicweb] On-the-fly modification of forms

St├ęphane Bugat stephane.bugat at free.fr
Wed Aug 22 09:57:00 CEST 2012


Sylvain, always about this "on-the-fly" modification of forms for one-way/two-way trips:

For my personal project, I've chosen finally to create a kind of "AirportSearch" entity, and gave up the ad hoc field form method... This is more convenient as a user can therefore have a favourite search, can access its last 10 searches, and so on. 

Following the example given in http://docs.cubicweb.org/devweb/edition/examples.html, I'd like to modify the default FormView for the AirportSearch entity. First, there is some slight differences with the given example derived from ChangeStateFormView: for entity edition it seems that I have to overwrite the EditionFormView class of cubicweb.web.views.editforms, is that correct?

After, it seems that EditionFormView does not have this convenient method, get_form(), that returns the current entity form. In place of I found a render_form() method, which controls the rendering of the form. My problem is that I just want to add some formfields and not rewrite the whole thing... How do I proceed?

Thanks a lot

Stephane



More information about the Cubicweb mailing list