IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New How complex do you want to get?
There are templating systems for Perl, Python, and Java that will allow you to put the template in a separate file, then provide the template name and the data to put in it to the engine and have it produce the merged output. Most of them will have looping constructs in the template language, so you can provide, say, a list and have the template produce code for each iteration in the list.

If you're feeling lucky, you could even use Word's mail merge, I suppose. :-P
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New So, what would be a good one for Python?
I'll take Perl, too.

The idea is simple enough:

\n===================\n|                 |\n|    Logo         |\n|  Company Name   |\n|  Person Name    |\n|   Address       |\n|    Phone        | \n|     FAX         |\n===================\n


Company name may be a link in some cases. URL and logo file name come from DB.

Repeat the above for all record in query result, placing 15 record per page, generating links to next page, previous page, first, last.

It should also be flexible enough to allow fancier things if I have time later, e.g. generating alphabetical index.


--

This guy's ahead of his time! He's using quantum programming methods: in universes where invalid data is passed to this function, it does not return. Thus you are ensured that you will only have valid data after calling it. Optimally you'd destroy the universe on failure, but computers haven't quite advanced to that level yet.

-- [link|http://thedailywtf.com/archive/2004/10/26/2920.aspx|The] Daily WTF

New Sounds like a job for Perl's HTML::Template
I've never used it, but I know people who have[TM].
-YendorMike

"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety."
- Benjamin Franklin, 1759 Historical Review of Pennsylvania
New There are a ton of good Perl template modules
Each tackling different kinds of problems. For a comparison, see [link|http://perl.apache.org/docs/tutorials/tmpl/comparison/comparison.html|http://perl.apache.o...n/comparison.html]. While the choices described there do not include templating tools in different languages, the article at least gives a framework to think about what you want from a templating tool, which helps you judge for other languages.

But you're right that HTML::Template aims to be very simple to get started with. That also means that it lacks features that other templating modules include.

Cheers,
Ben
I have come to believe that idealism without discipline is a quick road to disaster, while discipline without idealism is pointless. -- Aaron Ward (my brother)
New That's the reason many people would choose Python
...there's no template because there doesn't need to be. If you spend 1 week learning the language, you can write what you need yourself in about an hour, AND the next such solution and the next one..., AND it'll be readable and usable in three years when the next guy comes along (even if that's you, again).
New That's going a bit far...
A good templating language can completely obviate the need for any programming at all in a simple job like this. Otherwise people wouldn't be writing generic templating systems for Python, and they definitely are. I've written one myself.
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New Meh. I'll meet that halfway
In my experience, most of the Python templating systems are just as hard to learn as writing your own in Python. Newbies often have a hard time discerning which few are not.
New So say it already
Which templating systems in Python are "the few that are not"? I am one of those newbies who have "hard time discerning".
--

This guy's ahead of his time! He's using quantum programming methods: in universes where invalid data is passed to this function, it does not return. Thus you are ensured that you will only have valid data after calling it. Optimally you'd destroy the universe on failure, but computers haven't quite advanced to that level yet.

-- [link|http://thedailywtf.com/archive/2004/10/26/2920.aspx|The] Daily WTF

New I can't think of any that do *everything* you want
The idea is simple enough:

===================
| |
| Logo |
| Company Name |
| Person Name |
| Address |
| Phone |
| FAX |
===================

Company name may be a link in some cases. URL and logo file name come from DB.

Repeat the above for all record in query result...


At this point pick whichever you like. Cheetah is probably best, given your simple page requirements. But there's no built-in database layer--you'll have to write that glue yourself using DBAPI or an odbc package.

...placing 15 record per page, generating links to next page, previous page, first, last.


I can't think of any that will do this part for you. So you'd have to write *some* code. Which leads us back to "might as well do it yourself". Soooo many projects like yours start with a templating engine, then hit the limitations of it, and roll their own anyway.
New *Sigh*
Then again, I get to code Python. Nothing to sigh about :)
--

It is illegitimate and utterly intolerant to impose such a view upon anyone, even upon yourselves.
-- [link|http://belmontclub.blogspot.com/|The Belmont Club]

     Static HTML from database - (Arkadiy) - (19)
         Or VB. - (mmoffitt)
         Prebuilt template system just for you - (FuManChu) - (15)
             Come on. - (Arkadiy) - (14)
                 XSLT? - (altmann) - (3)
                     UGH! He's better off with plain ol C code. - (tuberculosis) - (2)
                         Sorry - (altmann)
                         XSL isn't bad for simple, quick and dirty formatting - (admin)
                 How complex do you want to get? - (admin) - (9)
                     So, what would be a good one for Python? - (Arkadiy) - (8)
                         Sounds like a job for Perl's HTML::Template - (Yendor) - (1)
                             There are a ton of good Perl template modules - (ben_tilly)
                         That's the reason many people would choose Python - (FuManChu) - (5)
                             That's going a bit far... - (admin) - (4)
                                 Meh. I'll meet that halfway - (FuManChu) - (3)
                                     So say it already - (Arkadiy) - (2)
                                         I can't think of any that do *everything* you want - (FuManChu) - (1)
                                             *Sigh* - (Arkadiy)
         Me? :-) - (static) - (1)
             Can't rely on anything in th esrever beyond static pages. -NT - (Arkadiy)

Globes ... or flutes?
179 ms