plomino / Plomino

Powerful and flexible web-based application builder
33 stars 37 forks source link

Selection list and db traverse #819

Open ermancio opened 7 years ago

ermancio commented 7 years ago

Hi, In my Plomino DB I have a selection list populated from another Plomino db (dbname) My code for the selection list field is:

ID = plominoDocument.restrictedTraverse("/sitename/dbname/") view = ID.getView('MyView') return [d.MyField1 + ' ' + 'for' + ' ' + d.MyField2 for d in view.getAllDocuments()]

So I select one value and save.

Now in a view I need to show a column deriving from one more field ([d.MyField3 for d in view.getAllDocuments()]); obviously this field must be related to the document containing MyField1 and MyField2.

Could you all suggest me an approach?

ebrehault commented 7 years ago

I would suggest to store the doc id, so you can display the MyField1 value or the MyField2, MyField3 or any other field whenever you need.