I have a problem with a database in SqlServer 2008, I'm doing some reports to show them in a Django project from a production database, which is used by another system, I have the following view:
class DetalleDeuda(ListView):
model = T090Deudas
template_name = 'deudas.html'
context_object_name = 'deudas'
@method_decorator(permission_required('deudas.ver_deuda_prescrita',reverse_lazy('usuarios:permiso_denegado')))
def dispatch(self, *args, **kwargs):
self.contribuyente = self.kwargs['contribuyente']
return super(DetalleDeuda, self).dispatch(*args, **kwargs)
def get_context_data(self, **kwargs):
context = super(DetalleDeuda, self).get_context_data(**kwargs)
contrib = T001Contribuyente.objects.get(c001cod_cont=self.contribuyente)
context['contribuyente'] = contrib
return context
def get_queryset(self):
queryset = T090Deudas.objects.filter(c090cod_cont=self.contribuyente)
return queryset
But unfortunately the previous programmers named a column of the table T090Deudas, like c090year, so when I show the result in my template I get the following error:
Exception Type: UnicodeDecodeError
Exception Value: 'ascii' codec can not decode byte 0xc3 in position 19: ordinal not in range (128)
I can not change the name of the column, since this would mean altering the other system that is made in Visual Basic and it is quite large, I would like to know if it is possible to do something or simply I should do the query omitting that column.