def OnLoad(self, whereField, whereValue): returnd = LookupDB(self.tableName).Specific(whereValue, whereField, self.fieldName) try: jsond = json.loads(returnd) self.SetObjects(jsond) except: print('returnd Not JSON\'d') pout.v(jsond)
def OnSave(self, whereField, whereValue): a = self.GetLabel() try: returnd = LookupDB(self.tableName).UpdateSingle( self.fieldName, a, whereField, whereValue) except: pout.v( f'Table : {self.tableName} ; Field : {self.fieldName} ; WhereField : {whereField} ; whereValue: {whereValue}' )
def OnSave(self, whereField, whereValue): a = self.GetValue() date_str = a.strftime('%d-%m-%Y %H:%M:%S') try: returnd = LookupDB(self.tableName).UpdateSingle( self.fieldName, b, whereField, whereValue) except: pout.v( f'Table : {self.tableName} ; Field : {self.fieldName} ; WhereField : {whereField} ; whereValue: {whereValue}' )
def OnLoad(self, whereField, whereValue): returnd = LookupDB(self.tableName).Specific(whereValue, whereField, self.fieldName) a = VarOps().GetTyped(returnd) pout.v(f'OnLoad Time Returnd : {returnd}') if returnd is None: returnd = datetime.datetime.strptime('01/01/1969', '%m/%d/%Y') date_obj = datetime.datetime.strptime(returnd, '%d-%m-%Y %H:%M:%S') self.SetValue(returnd)
def OnLoad(self, whereField, whereValue): returnd = LookupDB(self.tableName).Specific(whereValue, whereField, self.fieldName) a = VarOps().GetTyped(returnd) if 'tuple' in a: returnd = returnd[0] if returnd is None: returnd = datetime.datetime.strptime('01/01/1969', '%m/%d/%Y') self.SetValue(returnd)
def OnSave(self, whereField, whereValue): a = self.GetValue() b = VarOps().DoJson(a) try: returnd = LookupDB(self.tableName).UpdateSingle( self.fieldName, b, whereField, whereValue) except: pout.v( f'Table : {self.tableName} ; Field : {self.fieldName} ; WhereField : {whereField} ; whereValue: {whereValue}' )
def OnSave(self, whereField, whereValue): setTo = self.GetPath() pout.b(f'WhereField : {whereField} --> WhereValue : {whereValue}') pout.v(f'tableName : {self.tableName} ; fieldName : {self.fieldName}') try: item = LookupDB(self.tableName).UpdateSingle( self.fieldName, setTo, whereField, whereValue) except: pout.v( f'Table : {self.tableName} ; Field : {self.fieldName} ; WhereField : {whereField} ; whereValue: {whereValue}' )
def OnLoad(self, whereField, whereValue): returnd = LookupDB(self.tableName).Specific(whereValue, whereField, self.fieldName) jsond = VarOps().CheckJson(returnd) d = VarOps().GetTyped(jsond) print(f'jsond : {d}') if re.search('(list|tuple)', d, re.I): c = True a = VarOps().StrList(jsond) if jsond is not None and c is True: self.AppendItems(a)
def GetColor(self, color_for): note_color = '#f8fda9' info_color = '#e8f4f0' returnd = None try: returnd = LookupDB('themes').Specific(self.tname, 'theme_name', color_for) except: print() print(f'GetColor {self.tname} : Returnd : {returnd}') return returnd
def OnSave(self, whereField, whereValue): b = self.GetObjects() jsond = json.dumps(b) pout.v(f'GetSelectedObjects : {b}') try: returnd = LookupDB(self.tableName).UpdateSingle( self.fieldname, jsond, whereField, whereValue) except: pout.v( f'Table : {self.tableName} ; Field : {self.fieldName} ; WhereField : {whereField} ; whereValue: {whereValue}' )
def OnLoad(self, whereField, whereValue): returnd = LookupDB(self.tableName).Specific(whereValue, whereField, self.fieldName) a = VarOps().GetTyped(returnd) if 'tuple' in a: returnd = returnd[0] if returnd is None: returnd = '' try: self.SetLabel(returnd) except TypeError as e: pout.v(e)
def OnSave(self, whereField, whereValue): a = self.GetValue() pout.v(f'Date Picker Ctrl : {a}') b = a.FormatISODate() pout.v(f'Date Picker Crtl ISO Date : {b}') try: returnd = LookupDB(self.tableName).UpdateSingle( self.fieldName, b, whereField, whereValue) except: pout.v( f'Table : {self.tableName} ; Field : {self.fieldName} ; WhereField : {whereField} ; whereValue: {whereValue}' )
def OnLoad(self, whereField, whereValue): returnd = LookupDB(self.tableName).Specific(whereValue, whereField, self.fieldName) pout.v(returnd[0]) jsond = VarOps().CheckJson(returnd[0]) pout.v(returnd) pout.v(returnd[0]) j = json.loads(returnd) pout.v(f'RH_LoadSaveListBox : {j}') if jsond is not False: self.AppendItems(j)
def OnSave(self, whereField, whereValue): a = self.GetValue() if a is True: a = 1 if a is False: a = 0 try: returnd = LookupDB(self.tableName).UpdateSingle( self.fieldName, a, whereField, whereValue) except: pout.v( f'Table : {self.tableName} ; Field : {self.fieldName} ; WhereField : {whereField} ; whereValue: {whereValue}' )
def OnLoad(self, whereField, whereValue): returnd = LookupDB(self.tableName).Specific(whereValue, whereField, self.fieldName) a = VarOps().GetTyped(returnd) #pout.v(a) if 'tuple' in a: returnd = returnd[0] #pout.v('Tuple Unwound') a = VarOps().GetTyped(returnd) if 'decimal' in a: #pout.v('Convert Decimal -> float') returnd = float(returnd) if returnd is None: returnd = 0 a = VarOps().GetTyped(returnd) #pout.v(a) self.SetValue(returnd)
def DefaultChoices(self): returnd = LookupDB(self.DefTable).General(self.DefField) try: self.listd = returnd[0] except: pout.v(returnd)
def OnLoad(self, whereField, whereValue): val = LookupDB(self.tableName).Specific(whereValue, whereField, self.fieldName) self.SetCtrl(val)
def OnLoad(self, whereField, whereValue): returnd = LookupDB(self.tableName).Specific(whereValue, whereField, self.fieldName) jsond = VarOps().CheckJson(returnd) self.AppendItems(jsond)