1 # -*- coding: utf-8 -*-
 
   3 from time import mktime
 
   4 from piston.resource import Resource
 
   7     "converts a datetime.datetime object to a timestamp int"
 
   8     return int(mktime(dtime.timetuple()))
 
  10 class CsrfExemptResource(Resource):
 
  11     """A Custom Resource that is csrf exempt"""
 
  12     def __init__(self, handler, authentication=None):
 
  13         super(CsrfExemptResource, self).__init__(handler, authentication)
 
  14         self.csrf_exempt = getattr(self.handler, 'csrf_exempt', True)