from controllers.main_page import *
from controllers.book_owning_create import *
from controllers.book_yearning_create import *
application = webapp.WSGIApplication([
('/', MainPage),
('/bookowning/create', BookOwningCreate),
('/bookyearning/create', BookYearningCreate)
What I want to do is
from controllers import *
application = webapp.WSGIApplication([
('/', MainPage),
('/bookowning/create', BookOwningCreate),
('/bookyearning/create', BookYearningCreate)
It seems there is no really easy way to do it (that doesn't involve more typing). Also it seems to general consensus is to group classes in a module (ie. file).
The way I could do it would be to import all those classes in the __init__.py file of the controllers package. Like such:
(in __init__.py)
from book_owning_create import BookOwningCreate
from book_yearning_create import BookYearningCreate
No comments:
Post a Comment