Changeset 77
- Timestamp:
- 04/18/07 17:33:46
- Files:
-
- trunk/geniusql/dbtypes.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/geniusql/dbtypes.py
r76 r77 488 488 # You should REALLY check into your DB's encoding and override this. 489 489 encoding = 'utf8' 490 auto_pickle = True 490 491 491 492 def __copy__(self): … … 524 525 and 'signed'. 525 526 """ 527 if hints is None: 528 hints = {} 529 526 530 xform = "dbtype_for_" + getCoerceName(pytype) 527 531 try: 528 532 xform = getattr(self, xform) 529 533 except AttributeError: 530 raise TypeError("%r is not handled by %s. Tried %r" % 531 (pytype, self.__class__, xform)) 532 if hints is None: 533 hints = {} 534 # Assume we'll use a VARCHAR type and pickle the values. 535 if self.auto_pickle: 536 return self.dbtype_for_str(hints) 537 else: 538 raise TypeError("%r is not handled by %s. Tried %r" % 539 (pytype, self.__class__, xform)) 534 540 return xform(hints) 535 541 … … 562 568 % (bytes, dbtype.max_bytes)) 563 569 564 def dbtype_for_dict(self, hints):565 return self.dbtype_for_str(hints)566 def dbtype_for_list(self, hints):567 return self.dbtype_for_str(hints)568 def dbtype_for_tuple(self, hints):569 return self.dbtype_for_str(hints)570 570 def dbtype_for_unicode(self, hints): 571 return self.dbtype_for_str(hints)572 573 def dbtype_for_geniusql_logic_Expression(self, hints):574 571 return self.dbtype_for_str(hints) 575 572
