Access DB Object's column using a string

How can I access my DB object’s column?

Normally you would do something like this to access a column inside a database:

if poststr != None:
            dbvalue = Prijzen.objects.get(id=1)

            dbvalue.datumOphaling = value
            dbvalue.save()

            return HttpResponse(value)

(datumOphaling is a column inside my database)

But I want to be able to acces the column like this:

if poststr != None:
            dbvalue = Prijzen.objects.get(id=1)
            poststr = request.POST.get('functie', None)
            dbvalue.poststr = value
            dbvalue.save()

            return HttpResponse(value)

How would I achieve this, because in my last example it is not working?

Standard reminder - This is Python. You access a field within a model by variable name the same way you access any attribute from any class - using the getattr and setattr functions.

In this case, it would be something like this:
setattr(dbvalue, poststr, value)

By the way, unless you strictly filter that post data, you’re creating a massive security vulnerability by doing this. Unless there’s significantly more to this method than you’re showing here, this is a really bad design.