# Path: sesql/config.py
# CONFIG_PATH_FALLBACK = 'sesql_config'
#     CONFIG_PATH = getattr(settings, 'SESQL_CONFIG_PATH', CONFIG_PATH_FALLBACK)
#     CONFIG_PATH = CONFIG_PATH_FALLBACK
# 
# Path: sesql/typemap.py
# class TypeMap(object):
#     def __init__(self):
#     def all_subclasses(klass, done = None):
#     def all_tables(self):
#     def all_classes(self):
#     def all_class_names(self):
#     def get_class_names_for(self, table):
#     def get_classes_for(self, table):
#     def get_table_for(self, klass):
#     def get_class_by_name(self, klass):


from sesql import config
from sesql.typemap import typemap
    Decorator to execute or print SQL statements
    """
    def sql_function_inner(cursor = None, execute = False, verbosity = True,
                           include_drop = False,
                           **kwargs):
        sql = func(**kwargs)
        if not include_drop:
            sql = [ row for row in sql if not row.startswith('DROP ') ]
        if verbosity:
            print
            for row in sql:
                print row + ";"
            print
        if execute and cursor:
            for row in sql:
                cursor.execute(row)
    return sql_function_inner

@sql_function
def create_dictionnary():
    """
    Create the dictionnary configuration
    """
    return [
        "DROP TEXT SEARCH CONFIGURATION IF EXISTS public.%s" % config.TS_CONFIG_NAME,
        "CREATE TEXT SEARCH CONFIGURATION public.%s (COPY = pg_catalog.simple)" % config.TS_CONFIG_NAME,
        "DROP TEXT SEARCH DICTIONARY IF EXISTS public.%s_dict" % config.TS_CONFIG_NAME,
        """CREATE TEXT SEARCH DICTIONARY public.%s_dict (
        TEMPLATE = pg_catalog.simple,
        STOPWORDS = %s

# Path: sesql/config.py
# CONFIG_PATH_FALLBACK = 'sesql_config'
#     CONFIG_PATH = getattr(settings, 'SESQL_CONFIG_PATH', CONFIG_PATH_FALLBACK)
#     CONFIG_PATH = CONFIG_PATH_FALLBACK
# 
# Path: sesql/typemap.py
# class TypeMap(object):
#     def __init__(self):
#     def all_subclasses(klass, done = None):
#     def all_tables(self):
#     def all_classes(self):
#     def all_class_names(self):
#     def get_class_names_for(self, table):
#     def get_classes_for(self, table):
#     def get_table_for(self, klass):
#     def get_class_by_name(self, klass):


# Path: sesql/datamodel.py
from sesql import config
from sesql.typemap import typemap

    Decorator to execute or print SQL statements
    """
    def sql_function_inner(cursor = None, execute = False, verbosity = True,
                           include_drop = False,
                           **kwargs):
        sql = func(**kwargs)
        if not include_drop:
            sql = [ row for row in sql if not row.startswith('DROP ') ]
        if verbosity:
            print
            for row in sql:
                print row + ";"
            print
        if execute and cursor:
            for row in sql:
                cursor.execute(row)
    return sql_function_inner

@sql_function
def create_dictionnary():
    """
    Create the dictionnary configuration
    """
    return [
        "DROP TEXT SEARCH CONFIGURATION IF EXISTS public.%s" % config.TS_CONFIG_NAME,
        "CREATE TEXT SEARCH CONFIGURATION public.%s (COPY = pg_catalog.simple)" % config.TS_CONFIG_NAME,
        "DROP TEXT SEARCH DICTIONARY IF EXISTS public.%s_dict" % config.TS_CONFIG_NAME,
        """CREATE TEXT SEARCH DICTIONARY public.%s_dict (
        TEMPLATE = pg_catalog.simple,
        STOPWORDS = %s

)""" % (config.TS_CONFIG_NAME, config.STOPWORDS_FILE),