Django Formats: Writing Data to a Database

This document explains how to collect form data for submission in the form of mail. But how can this be done to write data to the database and make it accessible in the admin interface?

+3
source share
1 answer

The easiest way is to use ModelForm to create a form based on your model. A call form.save()in this form will automatically save your data in a database.

If you created your form manually, you will have to manually fill out the model instance and then call .save()on the model instance.

+7
source

Source: https://habr.com/ru/post/1792042/


All Articles