(self, model_attributes)
Determines the correct path to put each file and then calls create file method.
Determines the correct path to put each file and then calls create file method.
Determines the correct path to put each file and then calls create file method .
def create_files_from_templates(self, model_attributes):
        """
            Determines the correct path to put each file and then calls create file method.
        """
        for folder_name in ["views", "urls"]:
            file_path = "%s/%s/%s_%s.py" % (model_attributes['app_path'], folder_name,
                                            model_attributes['model_name_slug'], folder_name)
            template_path = "django_baker/%s" % (folder_name)
            self.create_file_from_template(file_path, template_path, model_attributes)
        for file_name in ["base", "list", "detail", "create", "update", "delete"]:
            file_path = "%s/templates/%s/%s_%s.html" % (model_attributes['app_path'], model_attributes['app_label'],
                                                        model_attributes['model_name_slug'], file_name)
            template_path = "django_baker/%s.html" % (file_name)
            self.create_file_from_template(file_path, template_path, model_attributes)
def create_files_from_templates ( self , model_attributes ) : for folder_name in [ "views" , "urls" ] : file_path = "%s/%s/%s_%s.py" % ( model_attributes [ 'app_path' ] , folder_name , model_attributes [ 'model_name_slug' ] , folder_name ) template_path = "django_baker/%s" % ( folder_name ) self . create_file_from_template ( file_path , template_path , model_attributes ) for file_name in [ "base" , "list" , "detail" , "create" , "update" , "delete" ] : file_path = "%s/templates/%s/%s_%s.html" % ( model_attributes [ 'app_path' ] , model_attributes [ 'app_label' ] , model_attributes [ 'model_name_slug' ] , file_name ) template_path = "django_baker/%s.html" % ( file_name ) self . create_file_from_template ( file_path , template_path , model_attributes )