the "**"  un-packs a dict.... which, by looking at gluon/sql.py,  looks like
what billf expected,

You can check if you've got the stars in the right place - try Bill's
definition in a test on your app:

python web2py.py -S my_app -M

and see what happens... you can work it out there...

On Wed, Nov 12, 2008 at 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to