source loading may now be skipped on generator init

This commit is contained in:
Yaroslav Klyuyev 2015-02-16 17:25:49 +02:00
parent 022f2a871c
commit 14dcaac892

View file

@ -88,13 +88,15 @@ class Template(object):
class FromTablesGenerator(BaseGenerator):
SOURCE = None
AUTOLOAD = True # you may want to set ``AUTOLOAD = False`` when subclassing table-based generator to skip soruce loading on init
def __init__(self):
super(FromTablesGenerator, self).__init__()
self.templates_choices = {}
self.templates = []
self.tables = {}
self.source_loader(self.SOURCE)
if self.AUTOLOAD:
self.source_loader(self.SOURCE)
def source_loader(self, source):
if source is None: