Re: send data to database

2019-12-24 Thread Kevin Dublin
Hi Leo, You'll want to use a model form in your forms.py, create an instance of it in the views.py to pass 'form' as a context variable, and then just let the model form render in the html template using {{ form }}. Check the docs: https://docs.djangoproject.com/en/3.0/topics/forms/modelforms/ T

send data to database

2019-12-24 Thread Leó Horváth
Hi guys, I want to create a form with radio buttons that sends data to a specific database field. How can I do it? My models.py looks like this: import datetime from django.db import models from django.utils import timezone # Create your models here. class Name(models.Model): user_name = m