~xrg/openobject-doc/trunk-xrg

« back to all changes in this revision

Viewing changes to source/developer/6_21_web_services/index.rst

  • Committer: TruongSinh Tran
  • Date: 2009-07-17 18:59:45 UTC
  • Revision ID: truongsinh@vipescoserver-20090717185945-ajjp3zso6xh5jddm
[FIX]private issue

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Working with Web Services
 
2
=========================
 
3
 
 
4
How to load data ?
 
5
------------------
 
6
 
 
7
 
 
8
   1. Postgresql
 
9
          * Simple, standard
 
10
          * Does not respect the WORKFLOW !!! 
 
11
   2. XML files (with –update=)
 
12
   3. XML-RPC
 
13
          * Script, same as website interface 
 
14
 
 
15
How to backup/restore a Postgresql database?
 
16
 
 
17
    backup
 
18
 
 
19
        pg_dump terp >terp.sql 
 
20
 
 
21
        restore
 
22
 
 
23
        createdb terp --encoding=unicode 
 
24
        psql terp < terp.sql 
 
25
        or 
 
26
        psql -d terp -f terp.sql 
 
27
 
 
28
The objects methods
 
29
-------------------
 
30
 
 
31
   1. create({'field':'value'})
 
32
          * return ID created 
 
33
   2. search([('arg1','=','value1')...], offset=0, limit=1000)
 
34
          * return [IDS] found 
 
35
   3. read([IDS], ['field1','field2',...])
 
36
          * return [{'id':1, 'field1':..., 'field2':..., ...}, ...] 
 
37
   4. write([IDS], {'field1':'value1','field2':3})
 
38
          * return True 
 
39
   5. unlink([IDS])
 
40
          * return True 
 
41
 
 
42
 
 
43
        
 
44