SV: Choosing the right framework

Discussion in 'Python' started by Carsten Gehling, Jul 17, 2003.

  1. > -----Oprindelig meddelelse-----
    > Fra:
    > [mailto:p]På vegne af David McNab
    > Sendt: 17. juli 2003 01:32
    > Til:
    > Emne: Re: Choosing the right framework


    > I've been working on an HTML generation framework called 'pyWeb'. Just
    > posted to this ng yesterday, calling for testers.
    >
    > You might like to visit http://www.freenet.org.nz/python/pyweb and have a
    > look.


    This I did - to be honest, I'm no real fan of frameworks where you make
    objects/functions to represent html-tags. It's IMHO not a good way to
    seperate logic and presentation. I'm more to the kind of templates where you
    write your own html snippets and embed som sort of template markers inside.

    But thanks anyway. :)

    I actually did this myself in PHP, but in a greater level of abstraction. I
    needed a fast way of creating "user interfaces" (dialog forms etc.), so I
    created a class hierarchy with tab-pages, layout managers, input controls,
    etc. that all conformed to the general design.

    The complete script for an dialog form to edit eg. an article would look
    like this (mind you - it's PHP):
    -------------------------------------
    $dlg = new UI_TabDialog("Edit article");
    $dlg->form_action = "artikel_update.php";
    $dlg->add_hidden_field("id", $id);

    $page = new UI_TabPage("Article");

    $layout = new UI_Layout_row(array(
    array(100),
    array(100),
    array(100),
    array(50, 50),
    array(100)
    ));

    $c = new UI_Control_static("Edit your article and click on "Save");
    $layout->add_control($c);

    $c = new UI_Control_input("title", "Header", "");
    $layout->add_control($c);

    $c = new UI_Control_textarea("body", "Main article text", "", 190);
    $layout->add_control($c);

    $c = new UI_Control_date("releasedate", "Release the article on",
    date("Y-m-d"));
    $layout->add_control($c);

    $c = new UI_Control_date("expiredate", "Expire the article on",
    date("Y-m-d"));
    $layout->add_control($c);

    $c = new UI_Control_image("image_id", "Attach image to article", "");
    $c->url_template = IMAGE_UPLOAD_PATH . "image_%d.jpg";
    $layout->add_control($c);

    $page->add_control($layout);

    $dlg->add_page($page);

    $dlg->draw();
    -------------------------------------

    - Carsten
    Carsten Gehling, Jul 17, 2003
    #1
    1. Advertising

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. Mark Siffer

    advice on choosing right control

    Mark Siffer, Jun 16, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    303
    Trevor Benedict R
    Jun 17, 2004
  2. shesh

    Choosing the right platform

    shesh, Jul 18, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    344
    jasonkester
    Jul 18, 2005
  3. Thomas Weholt \( PRIVAT \)

    Choosing the right database-system for a small project

    Thomas Weholt \( PRIVAT \), Jun 24, 2003, in forum: Python
    Replies:
    2
    Views:
    1,060
    Thomas Weholt \( PRIVAT \)
    Jun 24, 2003
  4. Carsten Gehling

    Choosing the right framework

    Carsten Gehling, Jul 16, 2003, in forum: Python
    Replies:
    9
    Views:
    292
    Ville Vainio
    Nov 27, 2003
  5. Carsten Gehling

    SV: Choosing the right framework

    Carsten Gehling, Jul 16, 2003, in forum: Python
    Replies:
    0
    Views:
    279
    Carsten Gehling
    Jul 16, 2003
Loading...

Share This Page