Ticket #1778 (assigned enhancement)

Opened 2 years ago

Last modified 23 months ago

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


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

comment:1 Changed 23 months ago by kindly

  • Milestone changed from ckan-v1.7 to ckan-v1.8

comment:2 Changed 23 months ago by seanh

  • Owner set to seanh
  • Status changed from new to assigned
  • Milestone changed from ckan-v1.8 to ckan-v1.9

comment:3 Changed 23 months ago by seanh

  • Milestone changed from ckan-v1.9 to ckan-future
Note: See TracTickets for help on using tickets.