/ Published in: Python
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
def form_data(form, queryset): for field in form.base_fields.keys(): data[field] = getattr(queryset, field) return data data = form_data(YourForm, queryset)