Massimo's solution sure is cunning, but you might something like this
a bit more maintainable:
def install():
if db(db.auth_group.id > 0).count() == 0:
db.auth_group.insert(role = 'edit')
db.auth_group.insert(role = 'moderate')
db.auth_group.insert(role = 'comment')
return
install()
On Nov 23, 11:28 am, Massimo Di Pierro <[email protected]>
wrote:
> yes because the file gets moved in a different folder after execution.
> It is a bit of a hack.
> We should think of a better way
>
> On Nov 22, 2:41 pm, petrasadi <[email protected]> wrote:
>
>
>
> > thank you for this, but I have one more question: is this guarantied to
> > execute only once (upon installation).- Hide quoted text -
>
> - Show quoted text -