[Pythonmac-SIG] re: OSA Range references

bkenniso@att.net bkenniso@att.net
Tue, 20 Feb 2001 18:24:19 -0500 (EST)


tom smith tom@othermedia.com 
Tue, 20 Feb 2001 18:13:39 +0000

>it's difficult to say without seeing your get_data() function. I can't
>remember whether FileMaker has a call where you could pass it a list of
>integers... If there is, I imagine you might have to use some aetools to
>build a list aeobject...
>
>then again , you could always...
>
>result_list = []
>
>for i in range(1,10):
>    record = db.get_data(i)
>    result_list.append(record)
>
>return result_list
>
>...which would make successive hits on the database.
>

Thanks for your response. 

I don't know much about this stuff but this is what I've figured
out so far from playing around and from the docs in the distribution.

The get_data function is generated by the gensuite.py module and is
an "event" for this package. All appleEvents have get passed the
same parameters:

<event>(self,_object,_attributes={},**_arguments)

Along with the "events" the gensuite modules generates classes for the
objects contained in the application. In my case I working with database 
records hence the record() class. These object classes help you express
the type of object you want to work with and I've been fairly succesful
is finding the syntax for expressing those objects. Along with the object
created for the application there are "generic" types that are imported 
through aetools from aetypes. I can say

db.get_data(record(Ordinal("first")) 

and get the first record but when I use the Range() class from aetypes I
get the error. 

The last parameter is a set of keyword args contained in _argmap_<event> 
varible generated by gensuite and I've been able to use them such as:

db.count(database(1),_class="crow"))

which returns the count of records in database 1. There is an element 
dictionary where you can lookup element codes ("crow") using the full
name of the element ("record"). 

I have yet to figure out how to use that 3rd param and wonder if that
might be the key. I also have yet to figure out "whose" or "where" 
clauses. 

The the events definitions then call the "send" method inherited from
aetools which calls the "sendevent" method which packs the parameters
passed to the event. 

I guess I'll have to dig deeper into what these pack methods actually
do. 

Again, thanks for you response,
-- Brian