Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > SV: Choosing the right framework

Reply
Thread Tools

SV: Choosing the right framework

 
 
Carsten Gehling
Guest
Posts: n/a
 
      07-17-2003
> -----Oprindelig meddelelse-----
> Fra: http://www.velocityreviews.com/forums/(E-Mail Removed)
> [mailto(E-Mail Removed)]På vegne af David McNab
> Sendt: 17. juli 2003 01:32
> Til: (E-Mail Removed)
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Choosing framework Mark Levison Ruby 4 05-24-2008 05:36 AM
Choosing the right framework Carsten Gehling Python 9 11-27-2003 10:05 AM
Need help choosing the right router. Robert Le Feve Cisco 3 11-19-2003 02:31 AM
Re: Choosing the right training company S. O'Brien MCSE 0 09-05-2003 01:58 PM
SV: Choosing the right framework Carsten Gehling Python 0 07-16-2003 02:54 PM



Advertisments