how can I iterate and retrieve all fields of a django model?
I know that foo.item._meta.get_all_field_names() brings me all field names.
How can I access those fields (incl. their actual values) on a model instance? (Except the normal notation foo.fieldname).
I need this in order to build a custom output for my model including its manyTomany relations.
Any ideas?
How about:
This should give you the field object, rather than the value in the given model instance. If you want the value of the field in the given model insance you can call it like this: