示例#1
0
    def initialize(self, db_table_object=None, definition_lod=None, attributes_lod=None, portlets_lod=None):
        ''' This initializes the Form. Following Data exchanges are to met:

            definition_lod = [{'column_name': 'id',
                                   => column which holds the content of this widget.
                               'widget_name': 'entry_name',
                                   => glade name of widget
                               'widget_object': gtk.Entry,
                                   => real object of the widget, filled automatically by glade!
                               'validation_function': self.validate,
                                   => if the attributes_lod can not validate automatically, use this.
                               'population_function': self.populate,
                                   => for combobox(entrys), tables and other nasty to-populate-mess!
                               'editable': True}]

            attributes_lod = [{'column_name': 'id'

                               'data_type': 'bigint'
                               'character_maximum_length': = 20
                               'numeric_precision' = 2
                               'numeric_scale' = ?
                               'is_nullable' = True}] 
                               
            portlets_lod = [{'portlet':   portlet_object,
                             'container': 'alignment_address' '''

        self.db_table = db_table_object
        
        self.definition_lod = definition_lod
        self.attributes_lod = attributes_lod
        self.portlets_lod = portlets_lod
        
        result = GtkTransformations.search_lod(self.attributes_lod, 'is_primary_key', True)
        if result <> None: 
            self.primary_key_column = result['column_name']
示例#2
0
    def initialize(self, db_table_object=None, definition_lod=None):
        ''' Initializes a treeview as table or tree. The definition_lod
            will be merged with the attributes_lod, thus the attributes_lod
            can be already contained in the definition_lod if desired!

            definition_lod = [{'column_name': 'id',

                               'column_label': 'Primärschlüssel',
                               'column_number': 0,

                               'visible': True,
                               'editable': True,
                               'sortable': True,
                               'resizeable': True,
                               'reorderable': True}]

           attributes_lod = [{'column_name': 'id'

                              'data_type': 'bigint'
                              'character_maximum_length': = 20
                              'numeric_precision' = 2
                              'numeric_scale' = ?
                              'is_nullable' = True}]'''

        self.db_table = db_table_object
        self.db_object = db_table_object.db_object

        self.definition_lod = definition_lod
        self.attributes_lod = self.db_table.attributes

        result = GtkTransformations.search_lod(self.attributes_lod,
                                               'is_primary_key', True)
        if result <> None:
            self.primary_key_column = result['column_name']

        self.Table.initialize(definition_lod=self.definition_lod,
                              attributes_lod=self.attributes_lod)

        # Just populate immideately if this is not a child-table of a form!
        if self.parent_form == None:
            self.populate()
示例#3
0
    def initialize(self,
                   db_table_object=None,
                   definition_lod=None,
                   attributes_lod=None,
                   portlets_lod=None):
        ''' This initializes the Form. Following Data exchanges are to met:

            definition_lod = [{'column_name': 'id',
                                   => column which holds the content of this widget.
                               'widget_name': 'entry_name',
                                   => glade name of widget
                               'widget_object': gtk.Entry,
                                   => real object of the widget, filled automatically by glade!
                               'validation_function': self.validate,
                                   => if the attributes_lod can not validate automatically, use this.
                               'population_function': self.populate,
                                   => for combobox(entrys), tables and other nasty to-populate-mess!
                               'editable': True}]

            attributes_lod = [{'column_name': 'id'

                               'data_type': 'bigint'
                               'character_maximum_length': = 20
                               'numeric_precision' = 2
                               'numeric_scale' = ?
                               'is_nullable' = True}] 
                               
            portlets_lod = [{'portlet':   portlet_object,
                             'container': 'alignment_address' '''

        self.db_table = db_table_object

        self.definition_lod = definition_lod
        self.attributes_lod = attributes_lod
        self.portlets_lod = portlets_lod

        result = GtkTransformations.search_lod(self.attributes_lod,
                                               'is_primary_key', True)
        if result <> None:
            self.primary_key_column = result['column_name']
示例#4
0
    def initialize(self, db_table_object=None, definition_lod=None):
        ''' Initializes a treeview as table or tree. The definition_lod
            will be merged with the attributes_lod, thus the attributes_lod
            can be already contained in the definition_lod if desired!

            definition_lod = [{'column_name': 'id',

                               'column_label': 'Primärschlüssel',
                               'column_number': 0,

                               'visible': True,
                               'editable': True,
                               'sortable': True,
                               'resizeable': True,
                               'reorderable': True}]

           attributes_lod = [{'column_name': 'id'

                              'data_type': 'bigint'
                              'character_maximum_length': = 20
                              'numeric_precision' = 2
                              'numeric_scale' = ?
                              'is_nullable' = True}]'''

        self.db_table = db_table_object
        self.db_object = db_table_object.db_object
        
        self.definition_lod = definition_lod
        self.attributes_lod = self.db_table.attributes
            
        result = GtkTransformations.search_lod(self.attributes_lod, 'is_primary_key', True)
        if result <> None: 
            self.primary_key_column = result['column_name']

        self.Table.initialize(definition_lod=self.definition_lod, attributes_lod=self.attributes_lod)
        
        # Just populate immideately if this is not a child-table of a form!
        if self.parent_form == None:
            self.populate()
示例#5
0
 def populate(self, content_lod, merge_field_list):
     self.content_lod = GtkTransformations.merge_fields(
         content_lod, merge_field_list, '#merged_fields')
     self.comboboxentry_user.populate(content_lod)
示例#6
0
 def populate(self, content_lod, merge_field_list):
     self.content_lod = GtkTransformations.merge_fields(content_lod, 
                                                         merge_field_list, 
                                                         '#merged_fields')
     self.comboboxentry_user.populate(content_lod)