Search This Blog

Thursday 22 November 2012

ACCESSING DATA FROM SERVER USING XMLRPC [OPENERP, PYTHON]

 Simple demo.py file for accessing data from server using xml rpc.



import xmlrpclib
import base64
import csv

server = '127.0.0.1'   (server IP address)
port = '8080'             (server port Number)
username = 'username'
password = 'pwd'
dbname = 'test61'     (Database Name from which you access the data)

url = 'http://' + server + ':' + port

common = xmlrpclib.ServerProxy(url + '/xmlrpc/common')

uid = common.login(dbname, username, password)

object = xmlrpclib.ServerProxy(url + '/xmlrpc/object')

so_ids = object.execute(dbname, uid, password, 'sale.order','search',[])

print "sale order ids ::::::::",so_ids

Password contain atleast alpha,symbol & digit [Python]]

This program is check that password must contain , alpha,number & digits

   test = "anilasdfasdfl234234234@@@@"
   new = tuple(test)
   data = list(new)
   is_symb =False
   is_digit = False
   is_alpha = False

   for d in data :
      if d.isdigit():
          is_digit = True
      if d.isalpha():
          is_alpha = True
      if not d.isdigit() and not d.isalpha():
          is_symb = True
          break

  if is_symb == True and is_digit == True and is_alpha == True:
      print "password matched::::"
  else :
      print "password dosen't match..."