3. datapath

Last page update: November 23, 2011

Note

validity - the datapath attribute is supported by:

Indeed, you can give the datapath attribute to more objects respect to the list, but it is useful give this attribute only to the objects that may contain other objects.

So, it is reasonable to give it to a container object (like a BorderContainer) but (usually!) it is not reasonable use it on a button

3.1. introduction

The datapath is an attribute used to create a hierarchy in your data

The element on which you apply this attribute will become the father of his children elements.

A child element can support both a relative path (relative to its father) or an absolute path: in every case, to define the (relative or absolute) path of a child you have to use the value attribute

3.2. syntax

  • absolutePathInDatastore: your data will be saved in its absolute path.
  • .relativePathInDatastore: your path will be relative. Pay attention that you can use this attribute only for a child object linked to a father on which the datapath attribute is defined.

Every dot (.) that you use have the meaning of a new subfolder; for example:

class GnrCustomWebPage(object):
    def main(self,root,**kwargs):
        bc = root.borderContainer(datapath='test1')
        bc.numberTextbox(value='^.number1')
        bc.numberTextbox(value='^number2')
        bc.numberTextbox(value='^.number.number3')

The first numberTextbox will have the following path: test1/number1 (this is a relative path). The second one will have the following path: number2 (that is an absolute path!). The third one will have the following path: test1/number/number3

3.3. symbolic datapath

A symbolic datapath is a path that allows to assign to an object the same path of another object.

Let’s suppose to have two objects (called A and B): the A object is the one you want to assign the path of the B object. To create a symbolic datapath, you have to give to the A object a datapath that begins with the sharp character (#) followed by a string equal to the nodeId value (string) of the B object.

Example:

TODO

3.4. special paths

There are some special syntaxes that allows you to move through the values’ path; they are:

3.4.1. attributes path

In order to access to an attribute (of a BagNode), you can ...TODO

3.4.2. #FORM path

TODO

#FORM.pkey is the current pkey of the record

3.4.3. parent path

TODO

You can access to the parent path through the #parent syntax.

Example:

TODO explanation!

value=’^.#parent.batch_note’

Table Of Contents

Previous topic

2. childname

Next topic

4. dbtable

This Page