DB TABLE (null is ok)
select * from TESTDB;
id | AAA | BBB | CCC |
======================
Django code
new_dataset = TESTDB(BBB = 222)
new_dataset.save()
I want to change code like this…
target_field = 'BBB'
new_dataset = TESTDB( target_field = 222 )
new_dataset.save()
How can I complete this code?
You can use dict as keyword arguments feature of Python: