Esempio n. 1
0
 def _update(self, new_dbptr):
     self.dbptr = new_dbptr
     self.database = self.dbptr[0]
     self.table = self.dbptr[1]
     self.field = self.dbptr[2]
     self.record = self.dbptr[3]
     if self.table != _ds.dbALL:
         if not _ds._dbquery(self.dbptr, _ds.dbTABLE_IS_VIEW):
             table = _ds._dbquery(self.dbptr, _ds.dbTABLE_NAME)
             self.field_tables[table] = _ds._dbquery(self.dbptr,
                                                     _ds.dbTABLE_FIELDS)
         else:
             view_tables = _ds._dbquery(self.dbptr, _ds.dbVIEW_TABLES)
             used_fields = []
             for table in view_tables:
                 tmp_dbptr = _ds._dblookup(self.dbptr, '', table, '', '')
                 fields = _ds._dbquery(tmp_dbptr, _ds.dbTABLE_FIELDS)
                 self.field_tables[table] = [field if field not in\
                         used_fields else '%s.%s' % (table, field)\
                         for field in fields]
                 used_fields += list(fields)
     return self
Esempio n. 2
0
 def lookup_clean(self, *args, **kwargs):
     #return self._update_cleanly(self.dbptr.lookup(*args, **kwargs))
     return self._update_cleanly(_ds._dblookup(self.dbptr,
                                 *_parse_lookup_args(*args, **kwargs)))
Esempio n. 3
0
 def lookup(self, *args, **kwargs):
     return self._update(_ds._dblookup(self.dbptr,
                         *_parse_lookup_args(*args, **kwargs)))