---------------
in class Item:
def index():
...
result = MyTableItem(item=item, ...) #item is foreign key pointing
to a table called Item
...
in class Place:
def index():
...
result = MyTablePlace(place=place, ...) #place is FK pointing to a
table called Place
...
...etc...
---------------
I want to put it into a common function but I don't know how to replace
the item=item part (or place=place) with a variable. This is what I
had in mind:
---------------
def commonFunction(myDBTable, type):
...
result = myDBTable(type=type, ...)
...
---------------
But obviously, the type=type part is wrong. Does anyone know how to fix
this?
Thanks so much,
Frank
def commonFunction(myDBTable, **kwargs):
# ...
result = myDBTable(**kwargs)
# ...
--
Timur Izhbulatov
OILspace, 26 Leninskaya sloboda, bld. 2, 2nd floor, 115280 Moscow, Russia
P:+7 495 105 7245 + ext.205 F:+7 495 105 7246 E:TimurIz...@oilspace.com
Building Successful Supply Chains - One Solution At A Time.
www.oilspace.com