[albatross-users] Trying to work around pagnation with colsissue...
Michael C. Neel
neel at mediapulse.com
Tue Jun 24 00:21:39 EST 2003
> A slightly nicer way of writing this might be:
>
> photos = [...]
> ctx.locals.photos = []
> i = 0
> while 1:
> row = photos[i:i+3]
> if not row: break
> ctx.locals.photos.append(row)
> i = i+3
>
> But that wasn't the question ;-)
>
I've been trying to adopt the python "feeling" that i's are bad and not
needed. My days as a C programmer reach for the C for loop (which is
what this really is, for(i=0, 1; i++)) but then I say no I should do it
without that because it's not the python way. Now I find the above a
lot harder to read, lol.
>
> What type of app (stateful/random, session in
> form/file/server etc) are
> you writing and what version of Albatross are you using?
>
SimpleApp; Apache 1.3x; mod_python. Using pagnation all over the place,
and for some odd reason this is the only one breaking.
I haven't gone to the pre-release because I have several Albatross sites
on the server so upgrading will be a real pain. Is there some way to
install it as a different name; i.e. albatrosspre110 so I could have it
side by side with 1.01? I tried installing it in the modules folder
with the app, but mod_python doesn't seem to wanna change the path order
(it will work command line, importing the right one, but not under
mod_python).
Mike
More information about the Albatross-users
mailing list