Ejemplo n.º 1
0
 def __init__(
     self,
     rpt,
     meth,
     name=None,
     label=None,
     doc=None,
     when=None,
     width=None,
     datatype=None,
 ):
     #self._owner = owner
     self.rpt = rpt
     if label is None:
         label = name
     Describable.__init__(self, None, name, label, doc)
     self.width = width
     #self.valign = valign
     #self.halign = halign
     if meth is None:
         meth = lambda x: x.item[self.index]
     self.meth = meth
     self.when = when
     if datatype is None:
         datatype = rpt.defaultDataType
     self.datatype = datatype
Ejemplo n.º 2
0
    def __init__(self, instanceClass, name=None, label=None, doc=None):
        if name is None:
            name = instanceClass.tableName
            #name = self.__class__.__name__

        if is_reserved(name):
            self._sqlName = "X" + name
        else:
            self._sqlName = name

        #if label is None:
        #    label = instanceClass.tableLabel
        if label is None:
            label = name

        self._instanceClass = instanceClass

        Describable.__init__(self, None, name, label, doc)
        SchemaComponent.__init__(self)
        FieldContainer.__init__(self)
        self._pk = None
        self._mandatoryColumns = None
        self._views = {}
        self._rowRenderer = None
        #self._mirrorLoader = None
        self._initStatus = 0
        self._defaultView = None
        self._pointers = []
Ejemplo n.º 3
0
    def __init__(self,instanceClass,
                 name=None,label=None,doc=None):
        if name is None:
            name = instanceClass.tableName
            #name = self.__class__.__name__


        if is_reserved(name):
            self._sqlName="X"+name
        else:
            self._sqlName=name
            
        #if label is None:
        #    label = instanceClass.tableLabel
        if label is None:
            label = name

        self._instanceClass=instanceClass
        
        Describable.__init__(self,None,name,label,doc)
        SchemaComponent.__init__(self)
        FieldContainer.__init__(self)
        self._pk = None
        self._mandatoryColumns = None
        self._views = {}
        self._rowRenderer = None
        #self._mirrorLoader = None
        self._initStatus = 0
        self._defaultView = None
        self._pointers=[]
Ejemplo n.º 4
0
 def __init__(self,toolkit,sess,data=None,
              halign=None, valign=None,
              *args,**kw):
     Describable.__init__(self,None,*args,**kw)
     MenuContainer.__init__(self)
     self.session=sess
     self.toolkit=toolkit
     self._parent = None # parent
     self.data = data
     #self.entries = AttrDict()
     self.buttons = AttrDict()
     self.tables = AttrDict()
     self.defaultButton = None
     self.valign = valign
     self.halign = halign
     self._boxes = []
     self.lastEvent = None
     self.mainComp = sess.toolkit.panelFactory(
         self, Container.VERTICAL)
     self._idleEvents = []
     self._onClose = []
     for m in ('addLabel','addViewer',
               'addEntry', 'addDataEntry',
               'addDataGrid','addNavigator',
               'addPanel','addVPanel','addHPanel',
               'addButton', 'VERTICAL', 'HORIZONTAL',
               'addOkButton', 'addCancelButton'):
         setattr(self,m,getattr(self.mainComp,m))
     if self.doc is not None:
         self.addLabel(self.doc)
Ejemplo n.º 5
0
 def __init__(self,
              toolkit,
              sess,
              data=None,
              halign=None,
              valign=None,
              *args,
              **kw):
     Describable.__init__(self, None, *args, **kw)
     MenuContainer.__init__(self)
     self.session = sess
     self.toolkit = toolkit
     self._parent = None  # parent
     self.data = data
     #self.entries = AttrDict()
     self.buttons = AttrDict()
     self.tables = AttrDict()
     self.defaultButton = None
     self.valign = valign
     self.halign = halign
     self._boxes = []
     self.lastEvent = None
     self.mainComp = sess.toolkit.panelFactory(self, Container.VERTICAL)
     self._idleEvents = []
     self._onClose = []
     for m in ('addLabel', 'addViewer', 'addEntry', 'addDataEntry',
               'addDataGrid', 'addNavigator', 'addPanel', 'addVPanel',
               'addHPanel', 'addButton', 'VERTICAL', 'HORIZONTAL',
               'addOkButton', 'addCancelButton'):
         setattr(self, m, getattr(self.mainComp, m))
     if self.doc is not None:
         self.addLabel(self.doc)
Ejemplo n.º 6
0
 def __init__(self, owner, name, label=None, doc=None):
     Describable.__init__(self, None, name, label, doc)
     #assert owner.__class__ is Table
     self._owner = owner
     self._isMandatory = False
     self._validator = None
     self._trigger = None
     self._deleted = False
Ejemplo n.º 7
0
 def __init__(self,owner,
              name=None,label=None,doc=None,
              enabled=True,
              weight=0):
     Describable.__init__(self,None,name,label,doc)
     self.owner = owner
     self.weight=weight
     self.enabled=enabled
Ejemplo n.º 8
0
 def __init__(self,owner, name,
              label=None,doc=None):
     Describable.__init__(self,None,name,label,doc)
     #assert owner.__class__ is Table
     self._owner = owner
     self._isMandatory = False
     self._validator = None
     self._trigger = None
     self._deleted=False
Ejemplo n.º 9
0
 def __init__(self,
              owner,
              name=None,
              label=None,
              doc=None,
              enabled=True,
              weight=0):
     Describable.__init__(self, None, name, label, doc)
     self.owner = owner
     self.weight = weight
     self.enabled = enabled
Ejemplo n.º 10
0
 def __init__(self,
              toolkit=None,
              years="",
              version=None,
              author=None,
              tempDir=".",
              #mainForm=None,
              #console=None,
              **kw):
     if toolkit is None:
         toolkit = gui.choose()
     self.toolkit = toolkit
     self.toolkit.addApplication(self)
     
     self.years = years
     self.version = version
     self.author = author
     self.tempDir = tempDir
     Describable.__init__(self,**kw)
     self.mainForm = None
Ejemplo n.º 11
0
 def __init__(self, rpt, meth,
              name=None,label=None,doc=None,
              when=None,
              width=None,
              datatype=None,
              ):
     #self._owner = owner
     self.rpt=rpt
     if label is None:
         label = name
     Describable.__init__(self, None, name,label,doc)
     self.width = width
     #self.valign = valign
     #self.halign = halign
     if meth is None:
         meth=lambda x : x.item[self.index]
     self.meth = meth
     self.when = when
     if datatype is None:
         datatype=rpt.defaultDataType
     self.datatype=datatype
Ejemplo n.º 12
0
    def __init__(
            self,
            toolkit=None,
            years="",
            version=None,
            author=None,
            tempDir=".",
            #mainForm=None,
            #console=None,
            **kw):
        if toolkit is None:
            toolkit = gui.choose()
        self.toolkit = toolkit
        self.toolkit.addApplication(self)

        self.years = years
        self.version = version
        self.author = author
        self.tempDir = tempDir
        Describable.__init__(self, **kw)
        self.mainForm = None
Ejemplo n.º 13
0
	def __init__(self,label,doc=None):
		Describable.__init__(self,None,label,doc)
		self._items = []
Ejemplo n.º 14
0
	def __init__(self,label,method,*args,**kw):
		#assert type(label) == type(""),"%s not a string" % repr(label)
		Describable.__init__(self,None,label)
		Action.__init__(self,method,*args,**kw)
Ejemplo n.º 15
0
 def configure(self,data=None,**kw):
     if data is not None:
         from lino.reports.reports import ReportRow
         assert isinstance(data,ReportRow)
     Describable.configure(self,data=data,**kw)
Ejemplo n.º 16
0
	def __init__(self,label=None,doc=None):
		Describable.__init__(self,None,label,doc)
		self._owner = None
Ejemplo n.º 17
0
	def __init__(self,label,doc=None):
		Describable.__init__(self,None,label,doc)
		self._items = []
Ejemplo n.º 18
0
	def __init__(self,label,method,*args,**kw):
		#assert type(label) == type(""),"%s not a string" % repr(label)
		Describable.__init__(self,None,label)
		Action.__init__(self,method,*args,**kw)
Ejemplo n.º 19
0
 def configure(self, data=None, **kw):
     if data is not None:
         from lino.reports.reports import ReportRow
         assert isinstance(data, ReportRow)
     Describable.configure(self, data=data, **kw)
Ejemplo n.º 20
0
 def __init__(self, label=None, doc=None):
     Describable.__init__(self, None, label, doc)
     self._owner = None