rewrite for achieving speedup

Johnny Blonde frank.wagner.1983 at googlemail.com
Tue Apr 17 16:48:54 CEST 2007


Hello Group!

I really tried hard for two hours to rewrite the following expression
(python 2.4):
--------------------------
teilnehmer = []
for r in Reisen.select(AND(Reisen.q.RESVON <= datum, Reisen.q.RESBIS
>= datum)):
	for g in r.BUCHUNGEN:
		for t in g.aktiveTeilnehmer:
			teilnehmer.append(t)
--------------------------

to something like
--------------------------
teilnehmer = [x for x in ........]
--------------------------

Reisen is a SQLObject class, Reisen.select(...), aktiveTeilnehmer and
BUCHUNGEN all are of the type SelectResults.

unfortunately i just can´t figure it out to make it work.
i hope someone maybe can help me?

I hope to gain performance by rewriting it...

Thanks a lot for your help!

Regards, Frank




More information about the Python-list mailing list