In my model, I define a pair of reusable fields:
authorstamp = SQLTable(None, 'authorstamp',
            db.Field('created_by', db.auth_user,
                          writable=False,
                          default=session.auth.user.id if
auth.is_logged_in() else 0),
            db.Field('modified_by', db.auth_user,
                          writable=False,
                          default=session.auth.user.id if
auth.is_logged_in() else 0,
                          update=session.auth.user.id if
auth.is_logged_in() else 0)
            )

With revision 877, this breaks:

Traceback (most recent call last):
  File "C:\Bin\web2py\gluon\restricted.py", line 107, in restricted
    exec ccode in environment
  File "C:/Bin/web2py/applications/sahana/models/00_db.py", line 80,
in <module>
    update=session.auth.user.id if auth.is_logged_in() else 0)
  File "C:\Bin\web2py\gluon\sql.py", line 1142, in __init__
    if not referenced in self._db:
TypeError: argument of type 'NoneType' is not iterable

The speedups look good, but I can't see why this now breaks the app:
http://bazaar.launchpad.net/~mdipierro/web2py/devel/revision/877

I can't also find another way of getting the same functionality :/

The reusable field is defined after 'auth' is instantiated.

Thanks,
F
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" 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