def build_context(self, using):
backend = connections[using].get_backend()
if not isinstance(backend, SolrSearchBackend):
raise ImproperlyConfigured("'%s' isn't configured as a SolrEngine)." % backend.connection_alias)
content_field_name, fields = backend.build_schema(
connections[using].get_unified_index().all_searchfields()
)
return Context({
'content_field_name': content_field_name,
'fields': fields,
'default_operator': constants.DEFAULT_OPERATOR,
'ID': constants.ID,
'DJANGO_CT': constants.DJANGO_CT,
'DJANGO_ID': constants.DJANGO_ID,
})
def build_template(self, using):
t = loader.get_template('search_configuration/solr.xml')
c = self.build_context(using=using)
return t.render(c)
I thought the t.render(c) function cause the TypeError,the param maybe a dict,not a Context instance.
what should I do about this?