You could do a
def install():
if db(db.table.id > 0).count() == 0:
db.table.insert(record1)
db.table.insert(record2)
if db(db.table2.id > 0).count() == 0:
db.table2.insert(record1)
install()
-Thadeus
On Fri, Mar 19, 2010 at 12:22 PM, Wes James <[email protected]> wrote:
> Here is how to get "web2py api search" plugin to work:
>
> 1. unzip web2py_api_srch.zip in to
> web2py/applications/admin/static/edit_area/plugins
> 2. unzip databases.zip in to web2py/applications/admin
> 3. add the following to web2py/applications/admin/models/0.py :
>
> db = DAL('sqlite://storage.sqlite')
>
> db.define_table(
> 'apis',
> Field('api'),
> Field('info')
> )
>
> 4. Makes changes to the end of the editAreaLoader.init in
> web2py/applications/admin/views/default/edit.html:
>
> , end_toolbar: "web2py_api_srch_but" {{if filetype=='html':}},plugins:
> "web2py_api_srch,zencoding"{{else:}},plugins:
> "web2py_api_srch"{{pass}}
>
> 5. Add the contents of controller.txt (apis function) to
> web2py/applications/admin/controllers/default.py
>
> ok - instead of doing all the attachments above, I'm just attaching
> admin.zip where I deleted everything but the necessary files.
>
> Anyone have any ideas on the db structure or how to populate it?
>
> -wes
>
> --
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To post to this group, send email to [email protected].
> 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.
>
>
--
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to [email protected].
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.