I have a textbox. When the user enters the " symbol. I had to strip that symbol before storing into the database.
Django code:
postDict = request.POST.copy()
profile = quser.get_profile()
profile.i_like= postDict['value']
profile=profile.save()
(Python answer) You can either remove the quotes by simply replacing them in the string (by using
myString.replace( '"', '' )) or – which would be a better solution – store the quotes in the database as well but just make sure that they are escaped correctly. How this works depends on your database, but “escaping” is a good keyword to search for, another would be “prepared statements” when you are using an SQL database.