You can store the function as a python expersion in your database and when you get the string just do something like eval(funcstr.replace('x', 'yvalue')).
To show you an example:
funcstr = '2*x+5'
evalpoint = funcstr.replace('x', '5')
val = eval(funcstr)