/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions | Public Attributes | Properties | Private Member Functions
DybDbiPre::Tab Class Reference

List of all members.

Public Member Functions

def __init__
def __repr__
def __call__

Public Attributes

 meta

Properties

 extras = property( _extras , doc=_extras.__doc__ )
 docstring = property( _docstring )

Private Member Functions

def _extras
def _docstring

Detailed Description

    :class:`DybDbiPre.Tab` instances are created by the parsing of :file:`.spec` files (:dybgaudi:`Database/DybDbi/spec`).
    Instances contain a list of dicts corresponding to each payload row in the DBI table together
    with a metadata dictionary for class level information.
       
    To test the parsing of a :file:`.spec` file, use for example::
    
          cat $DYBDBIROOT/spec/GSimPmtSpec.spec | python $DYBDBIPREROOT/python/DybDbiPre/__init__.py
    
    The instances are available in the django context used to fill templates
    :dybgaudi:`Database/DybDbi/templates` used in the generation of:
    
      #. DbiTableRow subclasses allowing DBI to interact with the table
      #. Documentation presenting the DBI tables in :file:`.tex` and wiki formats 
      #. SQL scripts for table creation :file:`.sql` 
    
    The meanings of the quantities in the :file:`.spec` are ultimately determined by their usage
    in the templates, however some guideline definitions are listed below:

    .. rubric:: row level quantities

    name
        column name as used in C++ getter and setter methods
    dbtype
        MySQL column type name used in table description, such as `double` or `int(10) unsigned`
    codetype 
        type used in generated C++ code, eg `DayaBay::FeeChannelId`
    legacy 
        name of the column in database table
    description
        short definition of the meaning of the column      
    code2db
        C++ converter function used to translate a value in code into a value stored in the DB, eg `.fullPackedData()` 
    memb
        name of the column data member in the C++ table row class, **WARNING, CURRENTLY NOT IN USE**         


    .. rubric:: class/table level properties

    meta
        a token that identifies the key, value pairs on the line as metadata rather than a table row 
    table
        name of the payload Database table, eg `CalibFeeSpec`
    class 
        name of the generated DbiTableRow class, follow convention of naming with a **G** prefix eg `GCalibFeeSpec`
    CanL2Cache
        set to `kFALSE`, L2 caching is for debugging only 
    legacy
        name of prior table when migrations are performed, **WARNING, CURRENTLY NOT IN USE**, set to table name             
    rctx
        default read context represented by a comma delimited string, see :dybgaudi:`Database/DybDbi/src/DbiCtx.cxx`  
    wctx
        default write context range represented by a comma delimited string, see :dybgaudi:`Database/DybDbi/src/DbiCtx.cxx` 


    .. rubric:: usage in templates

    The class level and row level quantities are used in django templates with expressions of the form::
         
        {{ t.meta.table }}   

        {% for r in t %}`{{ r.name }}` {{ r.dbtype }} default NULL COMMENT '{{ r.description }}',

  

Definition at line 5 of file __init__.py.


Constructor & Destructor Documentation

def DybDbiPre::Tab::__init__ (   self)

Definition at line 71 of file __init__.py.

00072                       :
00073         self.meta = {}


Member Function Documentation

def DybDbiPre::Tab::__repr__ (   self)

Definition at line 74 of file __init__.py.

00075                       :
00076         return "\n".join([repr(self.meta),list.__repr__(self)])

def DybDbiPre::Tab::_extras (   self) [private]
Extras property dict is updated into the context providing handy shortcuts  

Definition at line 77 of file __init__.py.

00078                      :
00079         """
00080         Extras property dict is updated into the context providing handy shortcuts  
00081         """ 
00082         verbose = int(os.environ.get('VERBOSE', 0 ))
00083         debug = verbose > 0
        return dict(cls=self.meta.get('class','ErrorNoClass'),kls=self.meta.get('legacy','ErrorNoLegacy'),f=self.meta.get('prefix','m_'),debug=debug)
def DybDbiPre::Tab::_docstring (   self) [private]

Definition at line 86 of file __init__.py.

00087                         :
        return self.docs.split("\n")
def DybDbiPre::Tab::__call__ (   self,
  d 
)
If fields in the :file:`.spec` file include a "meta" key then the  
fieldname(ie key),value pairs are included into the meta dictionary  

Definition at line 90 of file __init__.py.

00091                           :
00092         """
00093         If fields in the :file:`.spec` file include a "meta" key then the  
00094         fieldname(ie key),value pairs are included into the meta dictionary  
00095         """ 
00096         if d.has_key('meta'):
00097             self.meta.update(d)
00098         else:
00099             self.append(d)
00100 


Member Data Documentation

Definition at line 71 of file __init__.py.


Property Documentation

DybDbiPre::Tab::extras = property( _extras , doc=_extras.__doc__ ) [static]

Definition at line 84 of file __init__.py.

DybDbiPre::Tab::docstring = property( _docstring ) [static]

Definition at line 88 of file __init__.py.


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:50:12 for DybDbiPre by doxygen 1.7.4