From admin at ccj-online.co.uk Thu Nov 3 03:51:52 2005 From: admin at ccj-online.co.uk (John Abel) Date: Wed, 2 Nov 2005 16:51:52 +0000 Subject: [albatross-users] help! In-Reply-To: <4360E488.8010906@mediapulse.com> References: <4360E488.8010906@mediapulse.com> Message-ID: 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: >> >> >> >> Picture Will Go There> td> >> >> >> >> >> 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 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. From dpinte at itae.be Wed Nov 16 12:28:31 2005 From: dpinte at itae.be (Didrik Pinte) Date: Wed, 16 Nov 2005 02:28:31 +0100 Subject: [albatross-users] al-a help Message-ID: <1132104511.14396.11.camel@geru-itea> Hi, I'm using Albatross with pleasure but have a little problem. I'm a having an HomePage sending request to a StationPage. On the station page, I have implented pagination, etc. with success. Now, I'm trying to add sort capabilities on the data shown. I've followed the example code on the wiki ( http://www.object-craft.com.au/projects/albatross/wiki/Data_Presentation). So my table header looks like that (see full code below): The problem is that when I click on the column name, the link sends me back to my IndexPage and not anymore to the StationPage I was looking ... I suppose that I must add some variables to the request. I've tried to add __page__=station without success. I'm sure using a form this will work directly ... but it must be possible with a link, no ? Does anybody have an idea of the way to correct that ? Many thanks in advance, Didrik Pinte -- Here is the python code : class HomePage: name = 'index' def page_process(self,ctx): ctx.log('Processing index') if ctx.req_equals('goto'): ctx.log('Changing page to %s' % ctx.locals.goto) ctx.set_page(ctx.locals.goto) def page_display(self,ctx): ctx.load_template('header.html').to_html(ctx) ctx.load_template('footer.html').to_html(ctx) ctx.log('Displaying stations page') ctx.run_template('index.html') class StationPage: name = 'station' sC = webconfig.DbObjectConfig(dbscheme.stations) def page_enter(self, ctx): ''' Called when the user enters the page ''' ctx.log('Entering station page') ctx.default_session_var('_sort', None) def page_process(self,ctx): ''' Called when the user processes the form ''' ctx.log('Processing stations page') if ctx.req_equals('editstation'): ctx.log('Editing %s ... ') ctx.set_page('editstation') elif ctx.req_equals('sort'): # Store the sort attribute in the session var ctx.locals._sort = ctx.locals.sort elif ctx.req_equals('clear_filter'): # Set the filter string to None ctx.locals.filter_string = None def page_display(self,ctx): ''' Called when the user displays the page ''' ctx.load_template('header.html').to_html(ctx) ctx.load_template('footer.html').to_html(ctx) ctx.log('Displaying stations page') self.sC.getAll(sort=ctx.locals._sort,filter=getattr(ctx.locals, 'filter_string', None)) ctx.locals.dataSource = self.sC ctx.locals.title = 'Liste des stations du r??seau' ctx.locals.type = 'stations' ctx.locals.qualifier = 'configur??es' ctx.run_template('data.html') -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: From dpinte at itae.be Wed Nov 16 19:45:48 2005 From: dpinte at itae.be (Didrik Pinte) Date: Wed, 16 Nov 2005 09:45:48 +0100 Subject: [albatross-users] al-a help In-Reply-To: <1132104511.14396.11.camel@geru-itea> References: <1132104511.14396.11.camel@geru-itea> Message-ID: <1132130748.14396.16.camel@geru-itea> Just to clarify things (because it was late last night ;-) ). How can I do the following ? HomePage --> StationPage On the StationPage, having a tag redirecting to StationPage with a sort list attribute. At the moment, my tag sends me back to the HomePage and not the station page. Thanks Didrik -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL:
Edit