Issue 4631

Title
PYSON widget
Priority
feature
Status
resolved
Superseder
Add __repr__ to PYSON (issue 4607)
Project-Id-Version: Roundup 0.7.0 Report-Msgid-Bugs-To: roundup-devel@lists.sourceforge.net POT-Creation-Date: 2020-07-12 23:40-0400 PO-Revision-Date: 2004-11-20 13:47+0200 Language-Team: English Language: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii
Add string representation of pyson statements (issue 5952)
Project-Id-Version: Roundup 0.7.0 Report-Msgid-Bugs-To: roundup-devel@lists.sourceforge.net POT-Creation-Date: 2020-07-12 23:40-0400 PO-Revision-Date: 2004-11-20 13:47+0200 Language-Team: English Language: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii
patch to allow pyson decoding without evaluation (issue 1616)
Nosy list
ced, pokoli, reviewbot, roundup-bot
Assigned to
pokoli
Keywords
review

Created on 2015-03-09.19:44:39 by ced, last changed 57 months ago by roundup-bot.

Messages

New changeset ebb1c06f58e7 by Xavier Codinas in branch 'default':
Add PYSON widget
http://hg.tryton.org/sao/rev/ebb1c06f58e7
New changeset 5d4bd3c0858c by Sergi Almacellas Abellana in branch 'default':
Add PYSON widget
http://hg.tryton.org/tryton/rev/5d4bd3c0858c
New changeset 271c73cf8bae by Xavier Codinas in branch 'default':
Add PYSON widget
http://hg.tryton.org/trytond/rev/271c73cf8bae
Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2016-10-30.13:08:12
Thanks for the suggestion in msg29876, i implemented it on the latest sao review and it's working well. 

Only one note, on gtk client we can write "Eval('state') == 'draft'" which it gets converted to "Equal(Eval('state', ''), 'draft')" but on sao only the second version works because pyson object doesn't have operators implemented. So take care with this when testing. 

We are ready for testing now.
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2016-10-28.19:11:26
I have an idea. You could create a new scope 'Sao.PYSON.eval' which will contain for each PYSON object a method with the same name that just return 'new Sao.PYSON.Object'.

ex:

Sao.PYSON.eval.Eval = function(value, default_) { return new Sao.PYSON.Eval(value, default_); }

I would define each one just before the real Object to ensure to keep the API compatible.
Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2016-10-28.12:44:06
I have syncronized the sao review with the current tryton review, but I have problems evaluating the PYSON string in order to decode it. 

The main problem is that javascript classes require the new keyword in order to be initialized, but the pyson string does not contain this keywords. 

I don't know how to solve it. So any suggestions will be much appreciated.
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2016-10-27.17:42:31
Missing sao review
Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2016-10-14.10:38:43
I added issue5952 which adds the string representation of PYSON objects in sao.
Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2016-09-09.14:53:14
I updated all the reviews. tryton and trytond can be tested, for sao we are still missing the toString method of all objects as currently the PYSON widget is rendered as [Object Object]
Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2016-03-26.23:44:51
I added a partial implementation of sao patch in review20901002

Sao still misses issue1616
Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2016-03-22.10:40:58
I just added a small icon in the entry as suggested on msg25217
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2016-03-22.00:16:15
Indeed we never raise exception from the widget. So I think we should just set the value to None if it is not a valid statement.
But maybe it will be good to add a small icon in the Entry which could be green or red (OK - CANCEL). It will be updated on insert-text by evaluating the text.
Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2016-03-21.23:50:34
I uploaded review24011002 for trytond and review24021002

It still missed the SAO patch, but I will like to get more feedback GTK patch first. 

I'm not sure how to correctly raise exceptions when the entered pyson statement is not valid, so any guidance will be appreciated.
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2016-03-21.13:12:57
Yes except that the server doesn't need to decode. We only want to store the serialized version of PYSON.
Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2016-03-21.13:07:49
Correctly me if i'm wrong but this widged will be simply a Char (or Text) widget which converts (and validates) some input text to a valid PYSON expression (which will be decoded by the server)
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2015-03-09.19:44:38
From msg20447, a new widget will be great to ease the edition of PYSON expression from the client.
History
Date User Action Args
2016-10-31 13:42:33roundup-botsetmessages: + msg30063
2016-10-31 13:40:31roundup-botsetmessages: + msg30062
2016-10-31 13:39:29roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg30061
2016-10-30 13:29:11reviewbotsetmessages: + msg29921
2016-10-30 13:08:12pokolisetstatus: in-progress -> testing
messages: + msg29920
2016-10-30 13:03:36reviewbotsetmessages: + msg29919
2016-10-28 19:11:26cedsetmessages: + msg29876
2016-10-28 13:03:48reviewbotsetmessages: + msg29856
2016-10-28 13:03:48reviewbotsetreviews: 24021002, 24011002 -> 24021002, 24011002, 20901002
2016-10-28 12:44:06pokolisetmessages: + msg29855
2016-10-28 10:58:27reviewbotsetmessages: + msg29847
2016-10-28 10:27:55reviewbotsetmessages: + msg29842
2016-10-27 17:42:32cedsetmessages: + msg29814
2016-10-25 16:22:58reviewbotsetmessages: + msg29692
2016-10-21 12:27:17reviewbotsetmessages: + msg29564
2016-10-21 12:26:58reviewbotsetmessages: + msg29563
2016-10-14 10:38:43pokolisetmessages: + msg29369
superseder: + Add string representation of pyson statements
2016-10-13 17:31:19reviewbotsetmessages: + msg29352
2016-09-09 14:53:14pokolisetmessages: + msg28421
2016-09-09 14:22:04reviewbotsetmessages: + msg28418
2016-09-09 13:54:11reviewbotsetmessages: + msg28416
2016-09-09 13:53:56reviewbotsetnosy: + reviewbot
messages: + msg28415
2016-09-09 13:29:21pokolilinkissue5865 superseder
2016-03-26 23:44:51pokolisetmessages: + msg25286
2016-03-22 10:40:59pokolisetmessages: + msg25218
2016-03-22 00:16:15cedsetmessages: + msg25217
2016-03-22 00:03:43reviewbotsetreviews: 24021002 -> 24021002, 24011002
2016-03-22 00:00:20reviewbotsetreviews: 24021002
keyword: + review
2016-03-21 23:50:34pokolisetstatus: chatting -> in-progress
assignedto: pokoli
component: + trytond
messages: + msg25213
2016-03-21 13:12:58cedsetmessages: + msg25197
2016-03-21 13:07:49pokolisetstatus: unread -> chatting
nosy: + pokoli
messages: + msg25196
2015-03-09 19:44:39cedcreate