You can add a fixtures file, which basically contains default data to
be inserted when the table is created.

An example is given here: 
http://thadeusb.com/weblog/2010/4/21/using_fixtures_in_web2py

On Feb 10, 3:57 pm, Sascha Peilicke <[email protected]> wrote:
> Hi guys,
>
> I'd like to know how to best populate a table with a given set of default
> values. I could add them manually via the shell, but I'd like it to be done
> when the table is created. Let's consider the following table:
>
> db.define_table('tag',
>     Field('name'),
>     format='%(name)s')
>
> And assume I got some tags:
>
> TAGS = ['nice','great','awesome']
>
> So, how's the most appropriate way in getting those tags into the table?
> --
> Mit freundlichen Grüßen,
> Sascha Peilickehttp://saschpe.wordpress.com
>
>  signature.asc
> < 1KViewDownload

Reply via email to