May I ask why you are working so hard to avoid modifying the scaffolding
application? It is intended to be modified -- it's really just an example
app that you should customize to fit your specific needs.
Anthony
On Thursday, February 14, 2013 2:45:17 PM UTC-5, 黄祥 wrote:
>
> hi,
>
> is it possible to custom auth table on separate file not in db.py?
>
> for example :
> *models/db_wizard.py*
>
> # append fields : auth.signature
> db._common_fields.append(auth.signature)
>
> # custom auth user table
> auth.settings.extra_fields['auth_user']=[
> Field('gender', 'list:string'),
> Field('address', 'text'),
> Field('zip'),
> Field('city'),
> Field('country'),
> Field('phone')]
>
> i've already tested it that and it not work, it should define in db.py,
> but i want to have the application that not change the default web2py
> generate scaffolding application as much as possible, for example in db.py.
> the idea is because you can modified the define table (not auth tables) in
> different file on the fly.
>
> for example at first you define the blog table
> *### first*
> *models/db_wizard.py*
>
> # create table : blog
> db.define_table('blog',
> Field('title'),
> Field('contents', 'text'),
> format='%(title)s')
>
> and then you can modified it by adding the new field or rename the defined
> field on the fly
>
> *### second*
> *models/db_wizard.py*
>
> # create table : blog
> db.define_table('blog',
> Field('title'),
> *### rename the defined field*
> * Field('body', 'text'),*
> *### adding the new field*
> * Field('tag'),*
> format='%(title)s')
>
> many thanks in advance
>
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.