Does
CreditosDeEnergia.objects.get(pk=26).periodo_data
work for any valid value for pk in CreditosDeEnergia? Also, what’s the SQL definition for that table?
can you do a:
select periodo_data from creditos_de_energia where credito_id=26;
on your table? It seems like you may have a data error in the creditos_de_energia table.