Great. I think it is the best decission.
I have made new tests.
Auth still breaks on register,
Traceback (most recent call last):
File "/srv/lib/py4web/core.py", line 916, in wrapper
ret = func(*func_args, **func_kwargs)
File "/srv/lib/py4web/core.py", line 867, in wrapper
ret = func(*args, **kwargs)
File "/srv/lib/py4web/core.py", line 867, in wrapper
ret = func(*args, **kwargs)
File "/srv/lib/py4web/utils/auth.py", line 918, in _
form=form_factory(), path=path, user=auth.get_user(), **env
File "/srv/lib/py4web/utils/auth.py", line 1174, in register
res = self.auth.register(form.vars, validate=False)
File "/srv/lib/py4web/utils/auth.py", line 511, in register
res = store(fields)
File "/srv/lib/py4web/utils/auth.py", line 504, in store
return dict(id=self.db.auth_user.insert(**fields))
File "/srv/lib/pydal/objects.py", line 892, in insert
ret = self._db._adapter.insert(self, row.op_values())
File "/srv/lib/pydal/adapters/google.py", line 282, in insert
self.client.put(entity)
File "/layers/google.python.pip/pip/lib/python3.8/site-packages/google/cloud/datastore/client.py", line 575, in put
self.put_multi(entities=[entity], retry=retry, timeout=timeout)
File "/layers/google.python.pip/pip/lib/python3.8/site-packages/google/cloud/datastore/client.py", line 612, in put_multi
current.put(entity)
File "/layers/google.python.pip/pip/lib/python3.8/site-packages/google/cloud/datastore/batch.py", line 227, in put
_assign_entity_to_pb(entity_pb, entity)
File "/layers/google.python.pip/pip/lib/python3.8/site-packages/google/cloud/datastore/batch.py", line 373, in _assign_entity_to_pb
bare_entity_pb = helpers.entity_to_protobuf(entity)
File "/layers/google.python.pip/pip/lib/python3.8/site-packages/google/cloud/datastore/helpers.py", line 215, in entity_to_protobuf
_set_protobuf_value(value_pb, value)
File "/layers/google.python.pip/pip/lib/python3.8/site-packages/google/cloud/datastore/helpers.py", line 449, in _set_protobuf_value
attr, val = _pb_attr_value(val)
File "/layers/google.python.pip/pip/lib/python3.8/site-packages/google/cloud/datastore/helpers.py", line 366, in _pb_attr_value
raise ValueError("Unknown protobuf attr type", type(val))
ValueError: ('Unknown protobuf attr type', <class 'pydal.validators.LazyCrypt'>)
but I declared some indexes:
- kind: auth_user
properties:
- name: email
- name: id
- kind: auth_user
properties:
- name: username
- name: id
And then I could create one user from the admin grid I had implemented.
Request_password works and with the right configuration (gae configuration fails as I explain later), sends the mail to change the password, but reset_password fails because the like _or expresions:
"Traceback (most recent call last):
File "/srv/lib/py4web/core.py", line 916, in wrapper
ret = func(*func_args, **func_kwargs)
File "/srv/lib/py4web/core.py", line 867, in wrapper
ret = func(*args, **kwargs)
File "/srv/lib/py4web/core.py", line 867, in wrapper
ret = func(*args, **kwargs)
File "/srv/lib/py4web/utils/auth.py", line 918, in _
form=form_factory(), path=path, user=auth.get_user(), **env
File "/srv/lib/py4web/utils/auth.py", line 1323, in reset_password
user = self.auth.db(query).select().first()
File "/srv/lib/pydal/objects.py", line 2719, in select
return adapter.select(self.query, fields, attributes)
File "/srv/lib/pydal/adapters/google.py", line 235, in select
items, table = self.select_raw(query, fields, attributes)
File "/srv/lib/pydal/adapters/google.py", line 195, in select_raw
for item in self.parse_and_query(query):
File "/srv/lib/pydal/adapters/google.py", line 158, in parse_and_query
raise RuntimeError("Datastore cannot handle expressions like %s" % query.op.__name__)
RuntimeError: Datastore cannot handle expressions like _or"
The mail() has also errors in gae due to the use of the google.appengine.api library:
try:
from google.appengine.api import mail as google_mail
GAE = True
except ImportError:
GAE = False
and this is the error trace:
File "/srv/lib/py4web/utils/auth.py", line 804, in send
return self.sender.send(email, subject=subject, body=body)
File "/srv/lib/py4web/utils/mailer.py", line 758, in send
raise RuntimeError("Not running on GAE")
RuntimeError: Not running on GAE
Finally I tried a grid for the auth_user table and I got this error:
Traceback (most recent call last):
File "/srv/lib/py4web/core.py", line 916, in wrapper
ret = func(*func_args, **func_kwargs)
File "/srv/lib/py4web/core.py", line 867, in wrapper
ret = func(*args, **kwargs)
File "/srv/apps/best/controllers.py", line 93, in authgrid
grid = Grid(
File "/srv/lib/py4web/utils/grid.py", line 447, in __init__
self.process()
File "/srv/lib/py4web/utils/grid.py", line 655, in process
self.rows = db(query).select(*self.needed_fields, **select_params)
File "/srv/lib/pydal/objects.py", line 2719, in select
return adapter.select(self.query, fields, attributes)
File "/srv/lib/pydal/adapters/google.py", line 235, in select
items, table = self.select_raw(query, fields, attributes)
File "/srv/lib/pydal/adapters/google.py", line 217, in select_raw
first, op, second = item.op(item.first, item.second)
AttributeError: 'list' object has no attribute 'op'