I am using CherryPy and SQLALchemy and I am trying to put some code together to loop through the posted form vars and assign their values to my data object. There are a lot of cases where I want to do this and the data records have a LOT of fields.
So, if the class I am trying to assign the values to is User with Last_Name and First_Name columns, for example.
I can loop through the kwargs and get the form vars. The posted form-vars names/id's correspond with the column names on my User object.
But I don't know how to code an assignment as an expression
This_Object = User() ... gives me my data class/object
.. then I loop through the parms ...
for lcParm in kwargs:
lcVal = kwargs.get(lcParm,'')
..so, I can loop through and pick up the values, but how do I code the assignment of the value to the data object field?
The name is in lcParm (eg; Last_Name) .. but how do I code This_Object.lcParm = lcVal
Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.
"The time has come," the Walrus said,
"To talk of many things:
Of sets--and lists--and dictionaries--
Of variable kinks--
And why you see it changing not--
And why so strange are strings."
This part describes how variables and references (see …
On September 29, 2012, the Python 3.3.0 was released; nothing extremely unexpected, yet another, better version of Python. But, if you work in Microsoft Windows, you should notice that the Python Launcher for Windows was introduced wi…
Learn the basics of strings in Python: declaration, operations, indices, and slicing.
Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
Learn the basics of modules and packages in Python.
Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…