~cprov/launchpadlib/ubuntu

« back to all changes in this revision

Viewing changes to launchpadlib/docs/operations.txt

  • Committer: James Westby
  • Date: 2009-01-04 01:11:15 UTC
  • mfrom: (7.1.22 launchpadlib)
  • Revision ID: jw+debian@jameswestby.net-20090104011115-dr8i4hoegpqkc3mv
* New upstream snapshot.
  - Some fixes to the XSL.
  - Make launchpadlib take advantage of 'http_etag' information embedded
    in entry representations.
  - Make launchpadlib JSON-encode all outgoing strings that will be
    used as named operation arguments.
  - Make IPerson.archive available.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
    >>> from launchpadlib.testing.helpers import salgado_with_full_permissions
7
7
    >>> launchpad = salgado_with_full_permissions.login()
8
8
 
9
 
Non-string arguments to named operations are automatically converted
10
 
to JSON for transmission over the wire.
 
9
Arguments to named operations are automatically converted to JSON for
 
10
transmission over the wire.
11
11
 
12
12
    >>> ubuntu = launchpad.distributions['ubuntu']
13
13
    >>> [task for task in ubuntu.searchTasks(has_cve=True)]
14
14
    [...]
15
15
 
16
 
This works for POST as well as GET operations.
 
16
Strings that happen to be numbers are handled properly. Here, if "1.234"
 
17
were converted into a number at any point in the chain, the 'find'
 
18
operation on the server wouldn't know how to handle it and the request
 
19
would fail.
 
20
 
 
21
    >>> [people for people in launchpad.people.find(text="1.234")]
 
22
    []
 
23
 
 
24
The JSON conversion works for POST as well as GET operations.
17
25
 
18
26
    >>> bug = launchpad.bugs.createBug(target=ubuntu, title="Test bug",
19
27
    ...     description="Testing named operations", tags=["foo", "bar"])