~openerp/openerp-client-rpc-com-lib/rows

« back to all changes in this revision

Viewing changes to sample.py

  • Committer: Vo Minh Thu
  • Date: 2011-04-14 19:15:40 UTC
  • Revision ID: vmt@openerp.com-20110414191540-wx1tgafq6smx3ht9
THAZ EVEN BETTR API

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
# Future proof: the library should be Python 2.6+ and 3.x compatible.
4
4
from __future__ import print_function
5
5
 
6
 
# OpeneERP ROWS will be renamed if it proves useful.
 
6
# OpeneERP ROWS will be renamed if it proves to be useful.
7
7
import openerprows
8
8
 
9
9
if __name__ == '__main__':
52
52
  for p in rows.res_partner(1,2).where((c.name < 5) & (c.num > 3)).debug():
53
53
    pass
54
54
 
 
55
  # Simplified (overloaded) notation.
 
56
  for p in rows.res_partner((c.name < 5) & (c.num > 3))(1,2).debug():
 
57
    pass
 
58
 
 
59
  # In fact, since the return type is the same as the original one:
 
60
  for p in rows.res_partner((c.name < 5) & (c.num > 3))(1,2):
 
61
    pass
 
62
 
 
63
  # And thus:
 
64
  for p in rows.res_partner(c.name < 5)(c.num > 3):
 
65
    pass
 
66
 
55
67
  cx = (c.name < 4) & (c.attendees > 5) # & child_of(c.object.company_id, c.user.company_id)
56
68