A Databaser rises to the DatabaserClass. This latter is the deepest class for instancing Variables able to store values in hierarchic tables. Here, as a first step, the database method helps to set the
in the dict
View the Databaser notebook on [NbViewer](http://nbviewer.ipython.org/url/shareyoursystem.ouvaton.org/Databaser.ipynb)
# -*- coding: utf-8 -*-
"""
<DefineSource>
@Date : Fri Nov 14 13:20:38 2014 \n
@Author : Erwan Ledoux \n\n
</DefineSource>
A Databaser rises to the DatabaserClass. This latter is the deepest class for instancing
Variables able to store values in hierarchic tables. Here, as a first step,
the database method helps to set the <DatabasingKeyStr> in the __dict__
"""
#<DefineAugmentation>
import ShareYourSystem as SYS
BaseModuleStr="ShareYourSystem.Standards.Noders.Structurer"
DecorationModuleStr="ShareYourSystem.Standards.Classors.Classer"
SYS.setSubModule(globals())
#</DefineAugmentation>
#<ImportSpecificModules>
#</ImportSpecificModules>
#<DefineClass>
@DecorationClass(**{'ClassingSwitchMethodStrsList':['database']})
class DatabaserClass(
BaseClass
):
#Definition
RepresentingKeyStrsList=[
'ModeledSuffixStr',
'DatabasedCollectionStr',
'ModeledSuffixStr',
'ModeledPointDeriveControllerVariable'
]
def default_init(self,
_DatabasingKeyStr="",
_DatabasedCollectionStr="",
_ModeledSuffixStr="",
_ModeledPointDeriveControllerVariable=None,
**_KwargVariablesDict
):
#Call the parent __init__ method
BaseClass.__init__(self,**_KwargVariablesDict)
def do_database(self):
#set
if hasattr(self,'NodeKeyStr'):
self.DatabasingKeyStr=self.NodeKeyStr
self.DatabasedCollectionStr=self.NodeCollectionStr
#set
self.ModeledSuffixStr=self.DatabasingKeyStr+'Model'
#
if hasattr(self,'NodePointDeriveNoder'):
self.point(
self.NodePointDeriveNoder,
'ModeledPointDeriveControllerVariable'
)
#</DefineClass>
View the Databaser sources on Github
In [3]:
#ImportModules
import ShareYourSystem as SYS
from ShareYourSystem.Standards.Controllers import Storer
from ShareYourSystem.Standards.Modelers import Databaser
#Definition of a Storer instance with a noded databaser
MyStorer=Storer.StorerClass().collect(
"Datome",
"Things",
Databaser.DatabaserClass()
)
#database
MyStorer['<Datome>ThingsDatabaser'].database()
#Definition the AttestedStr
SYS._attest(
[
'MyStorer is '+SYS._str(
MyStorer,
**{
'RepresentingBaseKeyStrsListBool':False,
'RepresentingAlineaIsBool':False
}
)
]
)
#Print