New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Controllers should not have shortcuts #141

Closed
derks opened this Issue Jul 27, 2012 · 2 comments

Comments

Projects
None yet
1 participant
@derks
Member

derks commented Jul 27, 2012

The existing shortcuts might clash with someones command name needs. For example.. someone might have a command of 'log' which would class with self.log which is a shortcut to self.app.log. Should re-evaluate this atleast. If anything, users can create their own shortcuts pretty easily.

@ghost ghost assigned derks Jul 27, 2012

@derks

This comment has been minimized.

Show comment
Hide comment
@derks

derks Aug 3, 2012

Member

Majority of the cases would likely prefer the shortcuts exist. Anyway, the shortcut would be overridden by the function if the name clashes, the users would be getting what they wanted ... so not a huge deal. Removing from 2.0.0 for now.

Member

derks commented Aug 3, 2012

Majority of the cases would likely prefer the shortcuts exist. Anyway, the shortcut would be overridden by the function if the name clashes, the users would be getting what they wanted ... so not a huge deal. Removing from 2.0.0 for now.

@derks

This comment has been minimized.

Show comment
Hide comment
@derks

derks Sep 7, 2012

Member

Actually, this flags pylint with:

W0201:295:CementBaseController._setup: Attribute 'render' defined outside __init__

The following is bad practice:

# shortcuts
self.config = self.app.config
self.log = self.app.log
self.pargs = self.app.pargs
self.render = self.app.render

Can modify this to be something like:

@property
def _config(self):
    return self.app.config
Member

derks commented Sep 7, 2012

Actually, this flags pylint with:

W0201:295:CementBaseController._setup: Attribute 'render' defined outside __init__

The following is bad practice:

# shortcuts
self.config = self.app.config
self.log = self.app.log
self.pargs = self.app.pargs
self.render = self.app.render

Can modify this to be something like:

@property
def _config(self):
    return self.app.config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment