def blueprint_schemaform_config(blueprint_template):
    """Generates config,schema and model objects used in schemaform ui component for blueprints"""
    plugin = Plugin.query.filter_by(id=blueprint_template.plugin).first()
    schema = plugin.schema
    blueprint_schema = {'type': 'object', 'title': 'Comment', 'description': 'Description', 'required': ['name', 'description'], 'properties': {}}
    config = blueprint_template.config
    blueprint_model = {}

    allowed_attrs = blueprint_template.allowed_attrs
    blueprint_form = allowed_attrs
    allowed_attrs = ['name', 'description'] + allowed_attrs
    for attr in allowed_attrs:
        blueprint_schema['properties'][attr] = schema['properties'][attr]
        if attr in ('name', 'description'):
            blueprint_model[attr] = ''
        else:
            blueprint_model[attr] = config[attr]

    blueprint_form = [
        {
            "key": "name",
            "type": "textfield",
            "placeholder": "Blueprint name"
        },
        {
            "key": "description",
            "type": "textarea",
            "placeholder": "Blueprint details"
        }
    ] + blueprint_form

    blueprint_template.blueprint_schema = blueprint_schema
    blueprint_template.blueprint_form = blueprint_form
    blueprint_template.blueprint_model = blueprint_model

    return blueprint_template