I'm working on an app. During development, I wanted to make sure I
could do a clean build of the db. So I wiped everything -- deleted all
files under databases, sessions, errors, and any uploaded files and
old static files that were generated by the app.

So I start over populating the db. Some of the data I'm entering by
CSV and some manually. One of the things I'm entering manually is a
table created thus:

def create():

    form=SQLFORM.factory(db.mygroup,Field('invite','string'))

    if form.accepts(request.vars,session):
        mygroup_id=form.vars.id

        admin=auth.add_group('mygroup%d'%mygroup_id,'Group leader')
        auth.add_membership(admin)
        auth.add_permission(...)
        auth.add_permission(...)
        auth.add_permission(...)

        session.flash=DIV('Created mygroup:
%s'%form.vars.name,_class='info')
        redirect(URL(r=request,f='show_mygroups'))
    elif form.errors:
        response.flash=DIV('Please correct errors and resubmit
form',_class='error')
    return dict(title=T('Build Group'),form=form)


Before wiping the db, this used to work OK. Now, the mygroup_id gets
stuck on the first entry and doesn't budge off of 1, no matter how
many times I submit the group. Obviously, the db is not being updated.
However, eclipse shows the body of the form.accepts being executed.
What's going on?

Reply via email to