Removing to_field makes it work ok. I will investigate it more and file a ticket if appropiate. I also solved the template exception by making TEMPLATE_DEBUG=False. It came up that the error was the fact that __repr__ returned an int, not a string.
Andu

