~geser/launchpadlib/toc

« back to all changes in this revision

Viewing changes to launchpadlib/_browser.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2009-02-05 22:55:42 UTC
  • mfrom: (31.1.4 convert-datetime-309950)
  • Revision ID: launchpad@pqm.canonical.com-20090205225542-2sum16448sgoje3i
[r=gary, Edwin] [bug=309950] Handle the possibility that parameter values might be datetime objects. Convert them back to string form when sending data out.

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
from launchpadlib.errors import HTTPError
44
44
from launchpadlib._oauth.oauth import (
45
45
    OAuthRequest, OAuthSignatureMethod_PLAINTEXT)
46
 
from launchpadlib._utils import uri
 
46
from launchpadlib._utils import uri, json
 
47
from launchpadlib._utils.json import DatetimeJSONEncoder
47
48
 
48
49
 
49
50
OAUTH_REALM = 'https://api.launchpad.net'
261
262
            headers['If-Match'] = cached_etag
262
263
 
263
264
        self._request(
264
 
            url, simplejson.dumps(representation), 'PATCH',
265
 
            extra_headers=extra_headers)
 
265
            url, simplejson.dumps(representation, cls=DatetimeJSONEncoder),
 
266
            'PATCH', extra_headers=extra_headers)