Controller functions taking arguments, or functions with an extra
space like def index (): are hidden:

http://groups.google.com/group/web2py/browse_thread/thread/35c15761dc3801e7/b0ee7945e272922e?lnk=gst&q=arguments+space+#b0ee7945e272922e

This is good that you can hide functions somehow, but using only a
regex to detect controller functions requires people to copy-paste
common actions into every controller (bad).

Could a controller be loaded, and its symbols that are functions
checked for a tag (attribute) indicating that they are also exposed.
This way you can import actions/functions in the models and in the
individual controllers.

Proposal: continue to use the regex for backwards compatibility, but
also expose functions that are explicitly tagged as exposed by some
decorator.

Examples:

# in models/0.py
@T2.decorators.expose
def stats():
  return 'stats'

# in modules/crud.py
@T2.decorators.expose
def update():
  return 'update'

# in controllers/posts.py
from modules.crud import *

It would be fully backwards compatible!

Feedback?

Robin



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to