I have a very naive question. How to display subscripts in the Django form? For example, letters “OC” are the subscripts.
a. Is there a way to add some arguments in the label section? I have tried <sub>oc</sub>, but it was not recognized.
b. should I try other functions rather than str ?
Thanks for your help!
class KabamInp(forms.Form):
koc = forms.FloatField(label='koc (mL/g OC)')
class InputPage(webapp.RequestHandler):
def get(self):
html=str(kabamInp)
self.response.out.write(html)
app = webapp.WSGIApplication([('/.*', InputPage)], debug=True)
You can include html tags in your label if you mark the output as safe.
You should always take care when using
mark_safe, it can be dangerous when you are dealing with user input. In this case, it should be fine.