746 |
# |
# |
747 |
class TextLookupDisplayHandler(FieldDisplayHandler): |
class TextLookupDisplayHandler(FieldDisplayHandler): |
748 |
|
|
|
# def __init__(self, *args, **params): |
|
|
# FieldDisplayHandler.__init__(self, *args, **params) |
|
749 |
def __init__(self, entry, eventHandler, displayMask, inputMask= None): |
def __init__(self, entry, eventHandler, displayMask, inputMask= None): |
750 |
FieldDisplayHandler.__init__(self, entry, eventHandler, None) |
FieldDisplayHandler.__init__(self, entry, eventHandler, None) |
751 |
self.displayMask= entry._displaymask |
self.displayMask= entry._displaymask |
752 |
|
self._currentValue = "" |
753 |
|
self._currentDisplayValue = "" |
754 |
|
|
755 |
def beginEdit(self, event): |
def beginEdit(self, event): |
756 |
pass |
pass |
760 |
# print "hack! %s" % self.entry.name |
# print "hack! %s" % self.entry.name |
761 |
if value in (None,""): |
if value in (None,""): |
762 |
return "" |
return "" |
763 |
|
if value == self._currentValue: |
764 |
|
return self._currentDisplayValue |
765 |
descr = "" |
descr = "" |
766 |
if hasattr(self.entry,'datasource'): |
if hasattr(self.entry,'datasource'): |
767 |
if hasattr(self.entry,'foreign_key'): |
if hasattr(self.entry,'foreign_key'): |
784 |
# print "hack[1]! %s: %s" % (self.entry.name, str(descr)) |
# print "hack[1]! %s: %s" % (self.entry.name, str(descr)) |
785 |
except: |
except: |
786 |
pass |
pass |
787 |
|
self._currentValue = value |
788 |
|
self._currentDisplayValue = descr |
789 |
return descr |
return descr |
790 |
|
|
791 |
def _buildDisplay(self): |
def _buildDisplay(self): |