Simple Tutorial?

Asked by Alex Ezell

So, I have pyax installed and all the tests are running perfectly. My issue is that I can't seem to find any documentation about the methods pyax exposes or how to use it. I can infer some things from the tests and the demo, but not much because so much is wrapped up in using generated data.

What I would like to see and wouldn't mind helping to do is write a simple tutorial. Some of the ideas are:
1) Retrieve a list of all Leads (or Contacts, or Opportunities, or really any object) and print them nicely.
2) Retrieve a subset of of objects (using a SOQL query based on some user-input.
3) Retrieve a list of the fields available for a given object.

These would be simple and would not rely on fixture data but would make use of some of the more basic and needful aspects of using the Sforce API.

As I said, I'd be glad to help write up the instructions or what have you, though (perhaps obviously) my Python knowledge is just at the beginner level. I could at least take someone's code and work it into a tutorial.

Question information

Language:
English Edit question
Status:
Solved
For:
pyax Edit question
Assignee:
No assignee Edit question
Solved by:
Kevin Shuk
Solved:
Last query:
Last reply:
Revision history for this message
Best Kevin Shuk (surf) said :
#1

Alex,

Yes, documentation for pyax is non-existent as of yet.

There is a "demo.py" in the tests subdirectory (run this using the "demo" script in the bin directory) that takes you through some of the basic paces of pyax. Also, the various tests cover other operations as well.

I've tried to keep the calls reasonably similar to the Apex documentation, but what might cause some confuction is where the calls are. For example, some calls are availabe from the Connection instance - describeGlobal, getServerTimestamp, etc. You'll find that others are available from an SObject (or SObjectBatch) instance as well - update, delete, etc. The latter is for convenience. If you have an SObject, you can call delete on it. Otherwise, the Connection version of delete requires you to pass an sObjectId (or list of Ids).

Maybe starting with a basic tutorial based on demo.py would be good. It wouldn't cover everything, but it will handle the basic CRUD operations for both individual objects and batches.

--Kevin

Revision history for this message
Alex Ezell (aezell) said :
#2

Thanks surfous, that solved my question.