PEATDB/Tables.py
def body(self, master):
        """Show all record fields in entry fields or labels"""
        model = self.model        
        cols = self.recdata.keys()
        self.editable = []
        self.fieldnames = {}
        self.fieldvars = {}
        self.fieldvars['Name'] = StringVar()
        self.fieldvars['Name'].set(self.recname)
        Label(master, text='Rec Name:').grid(row=0,column=0,padx=2,pady=2,sticky='news')
        Entry(master, textvariable=self.fieldvars['Name'],
                relief=GROOVE,bg='yellow').grid(row=0,column=1,padx=2,pady=2,sticky='news')
        i=1
        for col in cols:
            self.fieldvars[col] = StringVar()
            if self.recdata.has_key(col):
                val = self.recdata[col]
                self.fieldvars[col].set(val)
            self.fieldnames[col] = Label(master, text=col).grid(row=i,column=0,padx=2,pady=2,sticky='news')
            ent = Entry(master, textvariable=self.fieldvars[col], relief=GROOVE,bg='white')
            ent.grid(row=i,column=1,padx=2,pady=2,sticky='news')
            if not type(self.recdata[col]) is StringType:
                ent.config(state=DISABLED)
            else:
                self.editable.append(col)
            i+=1
        top=self.winfo_toplevel()
        top.columnconfigure(1,weight=1)
        return
Show all record fields in entry fields or labels
Show all record fields in entry fields or labels
Show all record fields in entry fields or labels
def body(self, master):
        model = self.model        
        cols = self.recdata.keys()
        self.editable = []
        self.fieldnames = {}
        self.fieldvars = {}
        self.fieldvars['Name'] = StringVar()
        self.fieldvars['Name'].set(self.recname)
        Label(master, text='Rec Name:').grid(row=0,column=0,padx=2,pady=2,sticky='news')
        Entry(master, textvariable=self.fieldvars['Name'],
                relief=GROOVE,bg='yellow').grid(row=0,column=1,padx=2,pady=2,sticky='news')
        i=1
        for col in cols:
            self.fieldvars[col] = StringVar()
            if self.recdata.has_key(col):
                val = self.recdata[col]
                self.fieldvars[col].set(val)
            self.fieldnames[col] = Label(master, text=col).grid(row=i,column=0,padx=2,pady=2,sticky='news')
            ent = Entry(master, textvariable=self.fieldvars[col], relief=GROOVE,bg='white')
            ent.grid(row=i,column=1,padx=2,pady=2,sticky='news')
            if not type(self.recdata[col]) is StringType:
                ent.config(state=DISABLED)
            else:
                self.editable.append(col)
            i+=1
        top=self.winfo_toplevel()
        top.columnconfigure(1,weight=1)
        return
def body ( self , master ) : model = self . model cols = self . recdata . keys ( ) self . editable = [ ] self . fieldnames = { } self . fieldvars = { } self . fieldvars [ 'Name' ] = StringVar ( ) self . fieldvars [ 'Name' ] . set ( self . recname ) Label ( master , text = 'Rec Name:' ) . grid ( row = 0 , column = 0 , padx = 2 , pady = 2 , sticky = 'news' ) Entry ( master , textvariable = self . fieldvars [ 'Name' ] , relief = GROOVE , bg = 'yellow' ) . grid ( row = 0 , column = 1 , padx = 2 , pady = 2 , sticky = 'news' ) i = 1 for col in cols : self . fieldvars [ col ] = StringVar ( ) if self . recdata . has_key ( col ) : val = self . recdata [ col ] self . fieldvars [ col ] . set ( val ) self . fieldnames [ col ] = Label ( master , text = col ) . grid ( row = i , column = 0 , padx = 2 , pady = 2 , sticky = 'news' ) ent = Entry ( master , textvariable = self . fieldvars [ col ] , relief = GROOVE , bg = 'white' ) ent . grid ( row = i , column = 1 , padx = 2 , pady = 2 , sticky = 'news' ) if not type ( self . recdata [ col ] ) is StringType : ent . config ( state = DISABLED ) else : self . editable . append ( col ) i += 1 top = self . winfo_toplevel ( ) top . columnconfigure ( 1 , weight = 1 ) return
Show all record fields in entry fields or labels
Show all record fields in entry fields or labels
"""Show all record fields in entry fields or labels"""
self
master