On 18/02/13 01:53 -0800, Phi wrote: > > > The developers who have worked with Tryton claimed that one needs to > > work > > > in a very incremental manner, testing any small step, rolling back as > > soon > > > as something breaks, which i find not satisfying. > > > > Seem a logical approach "trial and error". > > > > Exactly, let me rephrase my point. Since it not easy to debug xml files > in Tryton, trial and error has become a working methodology, which is > not the most productive way of working. > Do you know of any tool that would ease developing Tryton xml?
You can use an editor that support the rng validation if you want. But for creating records, it will not be very helpful because it is a generic syntax. It is so because Tryton is modular and we can not know in advance the structure of the Models. For the views, now you can store them outside the database in the view directory and run the client in development mode. Like that you can change the view and see the change directly in the client without the database update process. > > > In short: first i'd like to understand what motivated the choice of xml > > for > > > representing GUI, > > > > Because it is a format that fit well to describe a GUI, see HTML or Glade. > > > > Glade is a GUI builder and related rendering machinery, which uses XML at > machine > level. > Unfortunately we don't have a similar RAD tool to design the Tryton GUI, do > we? Not in the base but there is (never tested) https://projects.bioecoforests.com/projects/tryton-editor > > > and their underlying schemas (they are remarkably "flat"). > > > > I don't understand. > > > > Right, i should have been more explicit. The structure of all Tryton "GUI" > XML > files i've seen so far is: > > tryton > \ data > \ record > \ record > \ record > ... > \ menuentry > \ menuentry > > I mean that all "record" and "menuentry" entries are at the same level, > under data. > > So, taking the example of menuentry: i expected something like: > > tryton > \ data > \ menuentry # An menu item under root > \ menuentry # This is a submenu if its parent > \ menuentry # Another submenu > \ menuentry # Another item under root > > Instead, Tryton makes the developer use "ref" attributes for defining > relations between entries. > > For more complex elements, i think a XML structure like below > would be much easier to deal with, compared to the "ref" attributes: > > \ menuentry > \ action > \ window > \ view > \ form > \ form It could be for the menuentry because the structure is quite simple but I don't see not soo much advantage because in many places we reuse the same records. For example a form view could be used by many actions. In your example you assume that we know all the possible tag but because of the modularity, we can not and I don't think we could provide a rnc file for this. Also here we are talking about records which are stored as row in the database. So the schema is as close as possible to the target and of course flat like a DB. > > > Second, i'm wondering if that would be an option in short term to be > > able > > > use directly plain Python as the representation language for the same > > > > Plain Python will make the client no more language independent. > > > > I think that one of the role of a server is to "render" the output > in accordance to the protocol of communication with the client. > So in principle any language should be OK on the server side for internal > processing, eventually at the cost of development. We take an other way with Tryton. It is based on a thin client which is responsible to make the rendering. Such design allow us to separate the UI and the data. > > > things, like, for example, in Django (forms, wizards, etc). > > > > I don't understand. Django generate HTML which is a kind of subset of > > XML. The big difference is that in Tryton we use a static description of > > the UI when Django use a templating language to generate a HTML for each > > view. > > So with Tryton, the client just fetch the XML that describe how to > > display a kind of record (Model) then it just fetch the data and never > > again the UI description. > > > Again, i probably didn't make my point clear. > I gave the example of Django as a "developer friendly" framework, where > Python is used extensively, for example for defining forms and wizards. Tryton is also. In the XML of the view, it is only the position of the widget that are defined. We think it is a good format for that as explain above. But almost everything else, like the on_change, states etc are define in Python. And I think in Django, you still have to write a HTML template somewhere. -- Cédric Krier B2CK SPRL Rue de Rotterdam, 4 4000 Liège Belgium Tel: +32 472 54 46 59 Email/Jabber: [email protected] Website: http://www.b2ck.com/
pgpVJoCCOVT3W.pgp
Description: PGP signature
