# Path: django_make_app/renderers.py
# class TemplateRenderer(object):
#     def __init__(self, templates_directory, template_name, item):
#         """
#         :type templates_directory: os.path
#         :type template_name: unicode
#         :type item: dict
#         """
#         self._templates_directory = templates_directory
#         self.template_name = template_name
#         self.item = item
# 
#     def _render_from_template(self, template_name, **kwargs):
#         loader = FileSystemLoader(self._templates_directory)
#         env = Environment(loader=loader)
#         template = env.get_template(template_name)
# 
#         render = template.render(**kwargs)
# 
#         render = render.replace("[[", "{{")
#         render = render.replace("]]", "}}")
# 
#         render = render.replace("[%", "{%")
#         render = render.replace("%]", "%}")
# 
#         return render
# 
#     def render(self, context):
#         """
# 
#         :type context: dict
#         """
#         if "_model" in self.item:
#             context.update({
#                 "current_model": self.item.get('_model')
#             })
# 
#         return self._render_from_template(self.template_name, **context)
# 
# Path: django_make_app/schema.py
# class YamlSchemaKeywords(object):
#     APPS = "apps"
#     APP_NAME = "name"
#     MODELS = "models"
# 
# class StructureKeyword(object):
#     NAME = "name"
#     TYPE = "type"
#     FOLDER = "folder"
#     FILE = "file"
#     RENDERER = "renderer"
#     ITEMS = "items"
#     TARGET_FILENAME = "_target_filename"
#     TEMPLATE_NAME = "template_name"
# 
# Path: django_make_app/utils.py
# def is_callable(obj):
#     return hasattr(obj, '__call__')


from django_make_app.renderers import TemplateRenderer
from django_make_app.schema import YamlSchemaKeywords, StructureKeyword
from django_make_app.utils import is_callable
            "items": [
                {
                    "type": "file",
                    "name": "__init__.py",
                    "renderer": TemplateRenderer
                },
                {
                    "type": "file",
                    "name": "factories.py",
                    "renderer": TemplateRenderer
                },
                generate_model_items
            ]
        },
        {
            "type": "folder",
            "name": "management",
            "items": [
                {
                    "type": "file",
                    "name": "__init__.py",
                    "renderer": TemplateRenderer
                },
                {
                    "type": "folder",
                    "name": "commands",
                    "items": [
                        {
                            "type": "file",
                            "name": "__init__.py",

# Path: django_make_app/renderers.py
# class TemplateRenderer(object):
#     def __init__(self, templates_directory, template_name, item):
#         """
#         :type templates_directory: os.path
#         :type template_name: unicode
#         :type item: dict
#         """
#         self._templates_directory = templates_directory
#         self.template_name = template_name
#         self.item = item
# 
#     def _render_from_template(self, template_name, **kwargs):
#         loader = FileSystemLoader(self._templates_directory)
#         env = Environment(loader=loader)
#         template = env.get_template(template_name)
# 
#         render = template.render(**kwargs)
# 
#         render = render.replace("[[", "{{")
#         render = render.replace("]]", "}}")
# 
#         render = render.replace("[%", "{%")
#         render = render.replace("%]", "%}")
# 
#         return render
# 
#     def render(self, context):
#         """
# 
#         :type context: dict
#         """
#         if "_model" in self.item:
#             context.update({
#                 "current_model": self.item.get('_model')
#             })
# 
#         return self._render_from_template(self.template_name, **context)
# 
# Path: django_make_app/schema.py
# class YamlSchemaKeywords(object):
#     APPS = "apps"
#     APP_NAME = "name"
#     MODELS = "models"
# 
# class StructureKeyword(object):
#     NAME = "name"
#     TYPE = "type"
#     FOLDER = "folder"
#     FILE = "file"
#     RENDERER = "renderer"
#     ITEMS = "items"
#     TARGET_FILENAME = "_target_filename"
#     TEMPLATE_NAME = "template_name"
# 
# Path: django_make_app/utils.py
# def is_callable(obj):
#     return hasattr(obj, '__call__')


# Path: django_make_app/structure.py
from django_make_app.renderers import TemplateRenderer
from django_make_app.schema import YamlSchemaKeywords, StructureKeyword
from django_make_app.utils import is_callable

            "items": [
                {
                    "type": "file",
                    "name": "__init__.py",
                    "renderer": TemplateRenderer
                },
                {
                    "type": "file",
                    "name": "factories.py",
                    "renderer": TemplateRenderer
                },
                generate_model_items
            ]
        },
        {
            "type": "folder",
            "name": "management",
            "items": [
                {
                    "type": "file",
                    "name": "__init__.py",
                    "renderer": TemplateRenderer
                },
                {
                    "type": "folder",
                    "name": "commands",
                    "items": [
                        {
                            "type": "file",
                            "name": "__init__.py",

                            "renderer": TemplateRenderer