Improve SourceColumn workflow by allowing explicit functions as columns. Remove usage of encapsulate. Move instances of 'extra_columns' to SourceColumn.

This commit is contained in:
Roberto Rosario
2015-08-16 14:26:41 -04:00
parent 938328bc14
commit 60bc327756
36 changed files with 366 additions and 389 deletions
+6 -4
View File
@@ -281,11 +281,13 @@ class SourceColumn(object):
# unhashable type: list
return ()
def __init__(self, source, label, attribute):
def __init__(self, source, label, attribute=None, func=None):
self.source = source
self.label = label
self.attribute = attribute
self.func = func
self.__class__._registry.setdefault(source, [])
self.__class__._registry[source].append(
{'label': label, 'attribute': attribute}
)
self.__class__._registry[source].append(self)
class CombinedSource(object):