Ticket #1778 (assigned enhancement)
Replace classmethod's with module-level functions
Reported by: | seanh | Owned by: | seanh |
---|---|---|---|
Priority: | awaiting triage | Milestone: | ckan-future |
Component: | ckan | Keywords: | refactoring |
Cc: | Repository: | ckan | |
Theme: | none |
Description
In many places we have @classmethods where simple module-level functions would do (and would be more idiomatic in Python), e.g. the get() classmethods in the model/ classes.
Doing it with module functions lets us type module.function() instead of module.Class.method().
In many cases we're importing classes directly with from module import Class and then doing Class.method(), but from module import foo is bad style: http://docs.python.org/dev/howto/doanddont.html
Change History
Note: See
TracTickets for help on using
tickets.