I've taken out the orderby clauses but the login failure still happens (I've
had those clauses in for earlier versions of web2py but it was worth
looking).

Perhaps these two statements (default.py in user() ) are the issue on GAE?
db.auth_user.billing_country.requires = IS_NULL_OR(IS_NOT_EMPTY())
db.auth_user.country.requires = IS_NULL_OR(IS_NOT_EMPTY())

I am using a custom form which doesn't not display these two fields so I've
added these two statements to keep the registration process happy which
would otherwise want values from the user for them.

in db.py both fields have the clause:
requires=IS_NULL_OR(IS_IN_DB(db,db.iso3166.id,'%(country)s')))

Does that aim/explanation make sense to you? The code is quite old but
perhaps Web2py is translating to GAE in a subtley different way? If I remove
both statements then registration fails so I can't simply remove them to
test if the app works on GAE.

Is there an alternative approach I could take? At least to test further?

2010/1/15 mdipierro <[email protected]>

> I  see a lot of orderby in those validators that create problems.
>
> I think the problem is there.
>
> Try remove the orderby and see if the error goes away.
>
> If it does there are two options:
> 1) you need an index
> 2) the query is somehow invalid on GAE
>
> Massimo
>
> On Jan 15, 11:17 am, Carl <[email protected]> wrote:
> > I made the changes you listed but the failed login still persists (you
> > probably expected it to but I was forever hopeful! :)
> >
> > I'll see if I can create a small app that replicates the issue and send
> it
> > to you.
> > thanks for your time.
> >
> > 2010/1/15 mdipierro <[email protected]>
> >
> > > I do not know why you experience the behavior that you do but there
> > > are some errors in those commented lines:
> >
> > > 1)
> >
> > >    #cdrdb.Field('country', db.iso3166, requires=IS_NULL_OR
> > > (IS_INT_IN_RANGE(0, 1e100))),
> >
> > > should be
> >
> > >    cdrdb.Field('country', db.iso3166, requires=IS_IN_DB
> > > (db,db.iso3166.id,'%(country)s'))
> >
> > > 2)
> >
> > >    #cdrdb.Field('agent_salutation', db.salutations,
> > > requires=IS_NULL_OR(IS_INT_IN_RANGE(0, 1e100))),
> >
> > > should be
> >
> > >    cdrdb.Field('agent_salutation', db.salutations,
> > > requires=IS_NULL_OR(db,db.salutations.id,'%(salutation)s'))
> >
> > > sure you want a reference for this and not a IS_IN_SET?
> >
> > > 3)
> >
> > >    #cdrdb.Field('agent_country', db.iso3166, label='Country',
> > > requires=IS_NULL_OR(IS_INT_IN_RANGE(0, 1e100))),
> >
> > > should be
> >
> > >    cdrdb.Field('agent_country', db.iso3166, label='Country',
> > > requires=IS_NULL_OR(IS_IN_DB(db,db.iso3166.id,'%(country)s'))
> >
> > > 4)
> >
> > >    #cdrdb.Field('billing_country', db.iso3166, label='Billing
> > > country', requires=IS_NULL_OR(IS_INT_IN_RANGE(0, 1e100)))
> >
> > > should be
> >
> > >    #cdrdb.Field('billing_country', db.iso3166, label='Billing
> > > country', requires=IS_NULL_OR(IS_IN_DB(db,db.iso3166.id,'%(country)
> > > s'))
> >
> > > 5)
> >
> > >    #cdrdb.auth_user.country.requires = IS_NULL_OR(IS_NOT_EMPTY())
> >
> > > I am not so sure what you need here.
> >
> > > Massimo
> >
> > > On Jan 15, 10:38 am, Carl <[email protected]> wrote:
> > > > hi
> >
> > > > I gotten down to the area that's tripping up.
> >
> > > > My app will login correctly if I comment out the following lines;
> > > > I've put those commented lines in context below...
> >
> > > > FILE: models/dp.py
> > > > db.define_table('iso3166',
> > > >                 SQLField('country', 'string', length=128,
> > > > required=True),
> > > >                 SQLField('country_iso', 'integer', required=True),
> > > >                 SQLField('country_order', 'integer', required=True))
> >
> > > > db.define_table('salutations',
> > > >                 SQLField('salutation', 'string', length=128,
> > > > required=True),
> > > >                 SQLField('salutation_order', 'integer',
> > > > required=True))
> >
> > > > auth.settings.table_user = db.define_table(
> > > >     auth.settings.table_user_name,
> > > >     db.Field('email', 'string', length=254, unique=True,
> notnull=True,
> > > > required=True,
> > > >              requires = [IS_LOWER(),
> > > >                          IS_EMAIL(),
> > > >                          IS_NOT_IN_DB
> > > > (db,'%s.email'%auth.settings.table_user_name)]),
> > > >     db.Field('password', 'password', length=512, readable=False,
> > > > notnull=True, required=True, label='Password',
> > > >              requires = [IS_NOT_EMPTY(),
> > > >                          CRYPT(key='12angrymen12apollo57envoy')]),
> > > >     db.Field('registration_key', length=128, writable=False,
> > > > readable=False, default=''),
> > > >     db.Field('first_name', 'string', length=128),
> > > >     db.Field('last_name', 'string', length=128),
> > > >     db.Field('job_title', 'string', length=128),
> > > >     db.Field('postcode', 'string', length=12),
> > > >     #cdrdb.Field('country', db.iso3166, requires=IS_NULL_OR
> > > > (IS_INT_IN_RANGE(0, 1e100))),
> > > >     #cdrdb.Field('agent_salutation', db.salutations,
> > > > requires=IS_NULL_OR(IS_INT_IN_RANGE(0, 1e100))),
> > > >     db.Field('agent_name', 'string', length=128, label='Company
> > > > name'),
> > > >     db.Field('agent_address', 'text', label='Company address'),
> > > >     db.Field('agent_postcode', 'string', length=12, label='Company
> > > > postcode'),
> > > >     #cdrdb.Field('agent_country', db.iso3166, label='Country',
> > > > requires=IS_NULL_OR(IS_INT_IN_RANGE(0, 1e100))),
> > > >     db.Field('billing_name', 'string', length=128, label='Billing
> > > > company name'),
> > > >     db.Field('billing_address', 'text', label='Billing address'),
> > > >     db.Field('billing_postcode', 'string', length=12, label='Billing
> > > > postcode'),
> > > >     #cdrdb.Field('billing_country', db.iso3166, label='Billing
> > > > country', requires=IS_NULL_OR(IS_INT_IN_RANGE(0, 1e100)))
> > > >     )
> >
> > > > FILE: controllers/default.py
> >
> > > > def user():
> > > >     auth.settings.expiration = 14 * 24 * 60 * 60 # 14 day sessions
> > > >     auth.settings.register_onaccept = lambda form:
> registerAgent(form)
> > > >     auth.settings.register_next = URL(r=request,f='account')
> > > >     auth.settings.login_next = URL(r=request,f='account')
> >
> > > >     #cdrdb.auth_user.agent_salutation.requires = IS_IN_DB(db,
> > > > db.salutations.id, '%(salutation)s',
> > > > orderby=db.salutations.salutation_order)
> > > >     #cdrdb.auth_user.agent_country.requires = IS_IN_DB(db,
> > > > db.iso3166.id, '%(country)s', orderby=db.iso3166.country_order)
> >
> > > >     #cdrdb.auth_user.billing_country.requires =
> IS_NULL_OR(IS_NOT_EMPTY
> > > > ())
> > > >     #cdrdb.auth_user.country.requires = IS_NULL_OR(IS_NOT_EMPTY())
> >
> > > >     return dict(form=auth())
> >
> > > > user.html
> > > > NOTE: I've NOT had to comment out any lines
> > > > {{extend 'layout.html'}}
> > > > <h2>{{=request.args(0).replace('_',' ').capitalize()}}</h2>
> > > > <p>Test 7</p>
> > > > {{if request.args(0)=='login':}}
> > > > {{=form}}
> > > > <a href="{{=URL(r=request,args='register')}}">register</a><br />
> > > > <a href="{{=URL(r=request,args='retrieve_password')}}">lost
> password</
> > > > a><br />
> > > > {{elif request.args(0)=='register':}}
> > > > {{=form.custom.begin}}
> > > > <table>
> > > > <tr id="auth_user_email__row"><td><label for="auth_user_email"
> > > > id="auth_user_email__label">Email:</label></td><td>
> > > > {{=form.custom.widget.email}}</td><td></td></tr>
> > > > <tr id="auth_user_password__row"><td><label for="auth_user_password"
> > > > id="auth_user_password__label">Password:</label></td><td>
> > > > {{=form.custom.widget.password}}</td><td></td></tr>
> > > > <tr class="auth_user_password_two__row" ><td><label
> for="password_two"
> > > > id="auth_user_password_two__label">Verify password:</label></
> > > > td><td><input name="password_two" type="password" />
> > > > {{if form.errors and form.errors.password_two:}}<div class="error"
> > > > id="password_two__error">Password fields don't match</div>{{pass}}</
> > > > td><td></td></tr>
> > > > <tr id="auth_user_agent_salutation__row"><td><label
> > > > for="auth_user_agent_salutation"
> > > > id="auth_user_agent_salutation__label">Title:</label></td><td>
> > > > {{=form.custom.widget.agent_salutation}}</td><td></td></tr>
> > > > <tr id="auth_user_first_name__row"><td><label
> > > > for="auth_user_first_name" id="auth_user_first_name__label">First
> > > > Name:</label></td><td>{{=form.custom.widget.first_name}}</td><td></
> > > > td></tr>
> > > > <tr id="auth_user_last_name__row"><td><label
> for="auth_user_last_name"
> > > > id="auth_user_last_name__label">Last Name:</label></td><td>
> > > > {{=form.custom.widget.last_name}}</td><td></td></tr>
> > > > <tr id="auth_user_agent_name__row"><td><label
> > > > for="auth_user_agent_name" id="auth_user_agent_name__label">Company
> > > > name:</label></td><td>{{=form.custom.widget.agent_name}}</td><td></
> > > > td></tr>
> > > > <tr id="auth_user_agent_country"><td><label
> > > > for="auth_user_agent_country"
> > > > id="auth_user_agent_country__label">Country:</label></td><td>
> > > > {{=form.custom.widget.agent_country}}</td><td></td></tr>
> > > > <tr id="submit_record__row"><td></td><td><input type="submit"
> > > > value="Register" /></td><td></td></tr>
> > > > </table>
> > > > {{=form.custom.end}}
> > > > {{else:}}
> > > > {{=form}}
> > > > {{pass}}
> >
> > > > BACK TO POSTING:
> > > > So... hopefully this in't too much for you to parse. However, say the
> > > > word and I'll build an app.
> >
> > > > On Jan 14, 10:47 pm, Carl <[email protected]> wrote:
> >
> > > > > yes I can login successfully using Welcome so that does help narrow
> it
> > > down.
> > > > > I start the skeleton build tomorrow!
> >
> > > > > all the best
> >
> > > > > 2010/1/14 mdipierro <[email protected]>
> >
> > > > > > Can you register and login in the Welcome app? that should be the
> > > > > > first test.
> >
> > > > > > On Jan 14, 3:43 pm, Carl <[email protected]> wrote:
> > > > > > > I went into each corner of my app on dev_appserver and then
> > > uploaded to
> > > > > > GAE
> > > > > > > but this didn't change the login behaviour.
> >
> > > > > > > Let me rebuild my app part by part from a skeleton and find the
> > > smallest
> > > > > > app
> > > > > > > that breaks. If I don't figure it out from that I can send you
> the
> > > app
> > > > > > that
> > > > > > > works and the app that breaks.
> >
> > > > > > > My first task of tomorrow!
> >
> > > > > > > 2010/1/14 mdipierro <[email protected]>
> >
> > > > > > > > Did you ever try register and login locally with
> dev-appserver
> > > before
> > > > > > > > uploading on GAE? Perhaps some index is missing and by
> running
> > > > > > > > locally, it would re-create the missing index.
> > > > > > > > Anyway, the behavior is strange and I do not fully understand
> it.
> > > > > > > > Could you email me the app?
> >
> > > > > > > > On Jan 14, 12:42 pm, Carl <[email protected]> wrote:
> > > > > > > > > Trying to login after several "counter" calls resets the
> count.
> >
> > > > > > > > > 2010/1/14 Carl <[email protected]>
> >
> > > > > > > > > > I added a function for counter... it works on GAE (and it
> > > works
> > > > > > locally
> > > > > > > > > > too)
> >
> > > > > > > > > > 2010/1/14 mdipierro <[email protected]>
> >
> > > > > > > > > >> Do your sessions work?
> >
> > > > > > > > > >> can you try a simple counter?
> >
> > > > > > > > > >> def counter(): return dict(c=session.c=(session.c or
> 0)+1)
> >
> > > > > > > > > >> On Jan 14, 11:50 am, Carl <[email protected]> wrote:
> > > > > > > > > >> > Registering a new user... I can see a new row in GAE's
> > > data
> > > > > > viewer
> > > > > > > > but
> > > > > > > > > >> > once created I don't get automatically logged in
> (which
> > > does
> > > > > > happen
> > > > > > > > > >> > locally). When I then try a login with these new user
> > > > > > credentials I
> > > > > > > > > >> > get the same silent fail.
> >
> > > > > > > > > >> > On Jan 14, 5:32 pm, mdipierro <
> [email protected]>
> > > wrote:
> >
> > > > > > > > > >> > > Can you please run a test to better identify the
> >
> > ...
> >
> > read more ยป
>
> --
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<web2py%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/web2py?hl=en.
>
>
>
>
--
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/web2py?hl=en.

Reply via email to