Errr.. Ya you guys were right. My commands were creating a crap-load
of duplicate groups in the database. In my mind, I figured the
add_group behavior would be similar to the create tables behavior of
web2py : where it only creates/updates the table if the table/fields
are not already there (if my
automated application initialization...
Automating application setup tasks is something we should probably do
more of in keeping with the Web2py "zero configuration" spirit. Seeing
your discussions here inspired me in my quest towards an eventual
config and/or application setup logging system of s
On Friday, April 1, 2011 2:22:55 PM UTC-4, Mike wrote:
>
> Nevermind. I thought there was a builtin web2py way for this but I
> just did this instead (after sifting more through the groups):
>
> def groupadd(check_group):
> if not db(db.auth_group.role==check_group).count():
> db.auth
That's pretty close to what I did. Since my groups are created once
and never changed I did one check to see if there are ANY groups
created. If not, I create the ones I care about:
if not db(db.auth_group).count():
db.auth_group.insert(role='root',description='Exactly what you
think it does
Nevermind. I thought there was a builtin web2py way for this but I
just did this instead (after sifting more through the groups):
def groupadd(check_group):
if not db(db.auth_group.role==check_group).count():
db.auth_group.insert(role=check_group)
groupadd('Admins')
groupadd('Maintenance
Yes, your model files will be executed upon every request, so you don't want
to add the default groups there. The easiest method might be to add groups
into the auth_groups table via appadmin (see
http://web2py.com/book/default/chapter/03#More-on-appadmin). You can get to
appadmin for your appl
6 matches
Mail list logo