Skip to content

Commit

Permalink
[master][noticket]: Removed long deprecated date format functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
David Read committed Jan 19, 2012
1 parent 4369a1f commit a3df675
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions ckan/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,26 +284,6 @@ def _get_revision_user(self):
Revision.groups = property(_get_groups)
Revision.user = property(_get_revision_user)

def strptimestamp(s):
'''Convert a string of an ISO date into a datetime.datetime object.
raises TypeError if the number of numbers in the string is not between 3
and 7 (see datetime constructor).
raises ValueError if any of the numbers are out of range.
'''
# TODO: METHOD DEPRECATED - use ckan.lib.helpers.date_str_to_datetime
log.warn('model.strptimestamp is deprecated - use ckan.lib.helpers.date_str_to_datetime instead')
import datetime, re
return datetime.datetime(*map(int, re.split('[^\d]', s)))

def strftimestamp(t):
'''Takes a datetime.datetime and returns it as an ISO string. For
a pretty printed string, use ckan.lib.helpers.render_datetime.
'''
# TODO: METHOD DEPRECATED - use ckan.lib.helpers.datetime_to_date_str
log.warn('model.strftimestamp is deprecated - use ckan.lib.helpers.datetime_to_date_str instead')
return t.isoformat()

def revision_as_dict(revision, include_packages=True, include_groups=True,ref_package_by='name'):
revision_dict = OrderedDict((
('id', revision.id),
Expand Down

0 comments on commit a3df675

Please sign in to comment.