encode forms in a way that django likes