-2

Using SuiteCrm for a customer database.

https://www.cdata.com/kb/tech/suitecrm-python-petl.rst

How can I write a sample code that would get all customer data named jeff and sort by age ?

I tried to do it in this way but however, I dont know if it is correct or wrong:

import petl as etl
import cdata.suitecrm as mod

cnxn = mod.connect("URL=http://mySuiteCRM.com;User=myUser;Password=myPassword;")

sql = "SELECT * FROM Contacts WHERE first_name = 'Tom' ORDER BY age"

table1 = etl.fromdb(cnxn, sql)

table2 = etl.sort(table1, 'age')

etl.tocsv(table2, 'contacts_data.csv')
ewokx
  • 2,204
  • 3
  • 14
  • 27

0 Answers0