I need to create a tool that will be used to create field mappings (between tables) in the most automatic way.
Here's the deal: imagine a table being added to another. (allows you to ignore the type of field, only for a second ...)
CREATE OR REPLACE TABLE fooA(
id,
name,
type,
foo)
CREATE OR REPLACE TABLE otherFooTable(
idFoo,
nameFoo,
spam)
I am going to create a structure like this:
fieldMap = {'otherFooTable': [('idFoo','id'),('nameFoo','name'),('spam','foo')]}
I could access this using (for example)
print fieldMap['tabelax'][0][1]
This is not a very complex structure, but can I encounter some problems using it? Are there any suggestions to solve this problem? I need to save (for now) at least inputTable (I don’t want to repeat it for each displayed field), inputField, outputField. There is no reason to store outputTable because it is always known in advance.
.
PS: , (, ) ?