Re: ANNOUNCE: JOTWeb 1.11, preview of new web application system.

Discussion in 'Python' started by Sean Reifschneider, Jun 24, 2003.

  1. On Mon, Jun 23, 2003 at 11:20:35AM +1000, Dave Cole wrote:
    >OK. I think I have been arguing the wrong issue :)

    Yeah, I think that may be the case... :) It does really boil down to
    a subjective issue, I don't like always having to have the python code
    that calls into the template.

    I would like to suggest that you include an example earlier on about
    making the global name-space available and an example of the abbreviated
    calling mechanisms. It was clear from my half hour of reading the docs
    that I could get by with anything less than a dozen lines of code...

    >I don't see how the Albatross approach is analogous to the above. Am
    >I missing something? As far as I can tell the only difference in the

    Most of it is that I'm working from an understanding of Albatross which
    is much shallower than yours. The examples in the documentation are
    rather unlike the shorter examples you've provided here. I mean, based
    on a half hour of looking at the docs, it looked like a typical
    Albatross page handler would be:

    import os
    from albatross import SimpleContext, ApplicationError

    script_name = os.environ['SCRIPT_NAME']
    request_uri = os.environ['REQUEST_URI']
    page = request_uri[len(script_name) + 1:]
    if not page:
    page = 'main.html'

    ctx = SimpleContext('templ') = page
    templ = ctx.load_template(page)
    except ApplicationError:
    templ = ctx.load_template('oops.html')


    print 'Content-Type: text/html'

    Had integration with Apache and the example:

    import code

    def page_display(ctx):

    been more clear, I probably would have looked further at Albatross at
    the time. I didn't *WANT* to build another web application thingy... I
    wanted to build web applications...

    One thing that I do like in JOTWeb is the cascading of modules and HTML
    templates. I set up a "templates.html" page in the top-level directory,
    and sub-directories can reference the templates within it, ditto for
    code or variables, etc...

    It seems likely that I could do something similar with Albatross, now
    that we've had this discussion, as I said in a previous message.

    I'm half tempted to either incorporate the ability to do this with
    Albatross in addition to SimpleTAL into JOTWeb, or look at switching
    over to Albatross... However, I really want to be building sites right
    now. <sigh>

    >remove the requirement for page modules. Consider the mixin classes
    >in this section.

    I had looked at the mixin reference quickly when I first looked at the
    docs, but I couldn't really understand how they were of use... Examples
    in this section of the document would be extremely useful to new
    Albatross users.

    >I wonder if the real difference between JOTWeb and Albatross is that
    >the Controller is mostly implicit in JOTWeb but explicit in Albatross.

    Yes, that's probably fair to say...

    The important thing is not to stop questioning. Curiosity has its own
    reason for existing. -- Albert Einstein
    Sean Reifschneider, Member of Technical Staff <>, ltd. - Linux Consulting since 1995. Qmail, Python, SysAdmin
    Sean Reifschneider, Jun 24, 2003
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sean Reifschneider
    Sean Reifschneider
    Jun 24, 2003
  2. Andy B
    Diane Pepetone
    Nov 25, 2008
  3. Andreas Otto
    Andreas Otto
    Sep 25, 2009
  4. Andreas Otto
    Andreas Otto
    Sep 25, 2009
  5. arnie
    Mark Dykun
    Aug 17, 2007

Share This Page