I need to use DynamicForm(form generated using database values), so I
am using this method, 
http://uswaretech.com/blog/2008/10/dynamic-forms-with-django/

Now the order in which I define the fields is not the same as that for
the rendered Html. If I change the line like setattr(EmployeeForm,
field.name, copy(type_mapping[field.type])), to setattr(EmployeeForm,
field.name, forms.CharField()), the order is maintained. Any pointers?

[
Intially I though that return type('EmployeeForm', (forms.Form, ),
dict(EmployeeForm.__dict__)), messes up the order, as
dict(EmpForm.__dict__) would not keep order, as dicts are unordered,
but somehow the order is being maintained even with this line, but
setattr(EmployeeForm, field.name, forms.CharField())
]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to