Yarko is almost right def my_insert(**vsql): db.people.insert(vsql) my_insert(name='Carl',address='av none 1')
no self unless my_insert is a method class A: def my_insert(self,**vsql): db.people.insert(vsql) a=A() a.my_insert(name='Carl',address='av none 1') On Nov 12, 4:25 pm, billf <[EMAIL PROTECTED]> wrote: > SQLTable.insert() just wants a dict so I think it should look like: > > my_insert(name='Carl',address='av none 1') > > def my_insert(self,**vsql): > db.people.insert(vsql) > > .. but I'm new to Python and I'm never sure where the asterisks should > go :-) > > On Nov 12, 8:09 pm, Heronim <[EMAIL PROTECTED]> wrote: > > > How do I pass the fields to insert as a parameter? > > > my_insert ("name='Carl', address = 'av none 1'") > > > def my_insert(self, vsql): > > db.people.insert(vsql) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---