Hi Cédric,
Thanks for taking time answering and trying to clear my doubts!
On Saturday, February 16, 2013 5:38:03 PM UTC+5:30, Cédric Krier wrote:
>
> On 16/02/13 02:41 -0800, Phi wrote:
> > My main difficulty one is regarding the xml files, their syntax and
> > structure (cross-references between the "classes" of objects).
> > So for me it's quite difficult to deal with these, and i cannot find a
> > sensible intellectual representation. I could not find much
> documentation
> > also to help.
>
> First becareful, there are two kinds of XML in Tryton:
>
> - The first follow this syntax [1] is used to create records in the
> database. Those records are readonly by default so it is not to use
> for initial import of data but for programmatic needs.
>
> I assume that you refer to "database fixtures" (constant database entries).
I'm with you that XML is a sensible language for that purpose.
> - The second (view) [2] are used to describe the GUI to the client. It
> is not for away of HTML in some way. More information here [3].
> But a common misunderstanding is that to register a view, you need to
> create a record in the database (the first kind of XML).
>
> OK.
> > 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?
> > 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?
> > 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
> > 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.
> > 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.
Cheers,
Philippe
>
> [1] http://hg.tryton.org/trytond/file/tip/trytond/tryton.rnc
> [2] http://hg.tryton.org/trytond/file/tip/trytond/ir/ui
> [3]
> http://doc.tryton.org/2.6/trytond/doc/topics/views/index.html#topics-views
>
> --
> Cédric Krier
>
> B2CK SPRL
> Rue de Rotterdam, 4
> 4000 Liège
> Belgium
> Tel: +32 472 54 46 59
> Email/Jabber: [email protected] <javascript:>
> Website: http://www.b2ck.com/
>
--
--
[email protected] mailing list
---
You received this message because you are subscribed to the Google Groups
"tryton" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.