~openerp-dev/openobject-doc/trunk

« back to all changes in this revision

Viewing changes to source/developer/1_3_oo_architecture/mvc_sql.rst

  • Committer: Antony Lesuisse
  • Date: 2010-03-05 16:46:40 UTC
  • Revision ID: al@openerp.com-20100305164640-9b7anc1t5ujha8lw
Merge doc into feature, before deletion of both features and doc. (odo)

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
    cr.execute('select country_id from res_partner_address where partner_id=%d', (partner_id,))
25
25
    country_id = cr.fetchone()[0]
26
26
    cr.execute('select name from res_country where id=%d', (country_id,))
 
27
    del partner_id
 
28
    del country_id
27
29
    country_name = cr.fetchone()[0]
28
30
 
29
31
Of course you can do better if you develop smartly in SQL, using joins or subqueries. But you have to be smart and most of the time you will not be able to make such improvements: