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?