[albatross-users] <al-for> help!

John Abel admin at ccj-online.co.uk
Thu Nov 3 03:51:52 EST 2005


Hi,

I've been playing with my pages, and found that the problem is  
specific to it running Apache on my iBook.  I've tested the same cgi/ 
template on a Debian machine, using a Twisted-based web server, and  
even on my iBook using a CGIHTTPServer based server.  Both returned  
the correct number of entries in the dictionary.

Thanks to all that responded!

Regards

J

On 27 Oct 2005, at 15:30, Gabriel Cooper wrote:

>
>
> John Abel wrote:
>
>> Hi!
>>
>> I'm hoping someone can point me in the right direction.  I have a   
>> dictionary containing paths, and a description for each.  I have   
>> assigned each to locals like so:
>>
>>     simpleCtx.locals.foundBooks = foundBooks
>>     simpleCtx.locals.bookLinks = foundBooks.keys()
>>
>> I've then iterated on the list with this:
>>
>>             <al-for iter="book" expr="bookLinks">
>>                 <tr>
>>                     <td style="width: 15%;">Picture Will Go There</ 
>> td>
>>                     <td><a href='<al-value expr="book.value 
>> ()">'><al- value expr="foundBooks[ book.value() ]"></a></td>
>>                 </tr>
>>             </al-for>
>>
>> The odd thing, is the list loops twice, and then exits.  If I run  
>> the  cgi from the command line, it processes the entire list, and  
>> displays  them all ( as per below ).
>
> The code looks fine to me. I'd suggest printing out bookLinks and  
> foundBooks in <al-value> tags just before the for loop to make sure  
> it was what you thought it was. Perhaps it was modified somewhere.  
> This idea is reinforced by the fact that the code itself works in a  
> controlled environment.
>
> Hope this helps.
>
> Gabriel.




More information about the Albatross-users mailing list