I have a very entry level question but I could figure it out… My question is how to save inputs created by Django forms to a database (like google datastore)? It seems like there is no .save or .put functions associated with forms. Can anyone give me some suggestions or point out some examples?
Thanks!
Here is the Django forms and the website is hosted by Google app engine.
import os
os.environ['DJANGO_SETTINGS_MODULE']='settings'
from django import forms
from django.utils.safestring import mark_safe
class KabamInp(forms.Form):
chemical_name = forms.CharField(widget=forms.Textarea (attrs={'cols': 20, 'rows': 2}))
Koc = forms.FloatField(label=mark_safe('K<sub>OC</sub> (mL/g OC)'),initial=25000)
you need to create a Model class for the Form and use the values you get from the form to create your entity.