Ticket #1778 (assigned enhancement)

Opened 16 months ago

Last modified 11 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

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

Changed 11 months ago by kindly

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

Changed 11 months ago by seanh

  • owner set to seanh
  • status changed from new to assigned
  • milestone changed from ckan-v1.8 to ckan-v1.9

Changed 11 months ago by seanh

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