Sure enough. So, I am thinking "out loud" here--what would be the
advantage of a function (or class) in the controller over a class in a
module?
1. Would I be able to get rid of the class and all of its attributes
because every variable in the single controller file is visible to all
functions?
If the functions are in the same controller file, any functions in that
file are available (I believe they must take at least one parameter to
distinguish them from controllers that respond to page requests).
Fair enough point about modules but...
I have 3 controllers that pretty much displayed the same data. The
differences are in initial filter status, whether edit controls are
displayed, and privileges for different user groups. As I worked, I
was making the same changes 3 times to the shared code
You have to manually restart the server to see changes in the module
directory. Life is simpler if you use Rocket for your local
development.
Modules are useful for common code. It doesn't make sense to have 15
controllers all doing pretty much the same thing.
Code in the modules directory cann
The track_changes should work fine. It's hard to tell if you need all th selfs
without seeing mor code. I'm not sure what you are trying to do but I would
rarely suggest doing that in a module. You'll save a lot of brain cells
avoiding modules.
So, I had put this:
from gluon.custom_import import track_changes; track_changes(True)
in my primary model, db.py.
But, it seemed to do no good. On a lark, I restarted apache (thereby,
web2py). And it worked. My subsequent changes to the module now seem
to get picked up.
It seems it is not e
6 matches
Mail list logo