Beginning importing with python again

View: New views
3 Messages — Rating Filter:   Alert me  

Beginning importing with python again

by Dirk Bartley :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Greetings


Trying to remember where I was a while ago.  Some of it is coming back.

I'm able to query, retrieve and display an enterprise like

criteria = [
  { 'conjunction' : 'AND', 'key' : 'bai_id', 'value' : '0CARTR',
'expression' : 'EQUALS' }
]
result = server.zogi.searchForObjects('Enterprise', criteria, 0)
if (len(result) == 0):
  print "Length = 0"
else :
  print "Length != 0"
  enterprise = result[0]
  print 'Found Enterprise # %d' % enterprise['objectId']
  for key in enterprise :
    print "key %s value %s" % (key, enterprise[key])


My question is how to query and retrieve a contact??

Dirk

--
OpenGroupware.org XML-RPC
xmlrpc@...
http://mail.opengroupware.org/mailman/listinfo/xmlrpc

Re: Beginning importing with python again

by Dirk Bartley :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Ahhh got it.  I remember now.

Thx


On Tue, 2009-08-25 at 09:30 -0400, Dirk Bartley wrote:

> Greetings
>
>
> Trying to remember where I was a while ago.  Some of it is coming back.
>
> I'm able to query, retrieve and display an enterprise like
>
> criteria = [
>   { 'conjunction' : 'AND', 'key' : 'bai_id', 'value' : '0CARTR',
> 'expression' : 'EQUALS' }
> ]
> result = server.zogi.searchForObjects('Enterprise', criteria, 0)
> if (len(result) == 0):
>   print "Length = 0"
> else :
>   print "Length != 0"
>   enterprise = result[0]
>   print 'Found Enterprise # %d' % enterprise['objectId']
>   for key in enterprise :
>     print "key %s value %s" % (key, enterprise[key])
>
>
> My question is how to query and retrieve a contact??
>
> Dirk
>

--
OpenGroupware.org XML-RPC
xmlrpc@...
http://mail.opengroupware.org/mailman/listinfo/xmlrpc

Re: Beginning importing with python again

by Adam Tauno Williams :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> Trying to remember where I was a while ago.  Some of it is coming back.
> I'm able to query, retrieve and display an enterprise like
> criteria = [
>   { 'conjunction' : 'AND', 'key' : 'bai_id', 'value' : '0CARTR',
> 'expression' : 'EQUALS' }
> ]
> result = server.zogi.searchForObjects('Enterprise', criteria, 0)
> if (len(result) == 0):
> My question is how to query and retrieve a contact??

Second example down on
<http://code.google.com/p/zogi/wiki/searchForObjects>  Basically
Enterprise and Contact searches are the same; except the fields are
different [of course].  Internally on the server Enterprises and
Contacts are both Company objects - think OOP inheritance, Contacts and
Enterprises both have addresses, phone numbers, company values, etc... -
so most [all?] operations, like searching and access control, work
identically for Contacts and Enterprises

--
OpenGroupware.org XML-RPC
xmlrpc@...
http://mail.opengroupware.org/mailman/listinfo/xmlrpc