[Tutor] Creating a database

Michael Janssen Janssen@rz.uni-frankfurt.de
Sun Mar 30 13:16:52 2003


On Sun, 30 Mar 2003, Billie wrote:

> Well, I'm off on a project, and want to know if Python will do the trick.
>
> I'm wanting to create a web page that lists names, addresses and phone
> numbers, and I want it to be storable.  Being new, first I'm sure it's
> possible, second, is it very difficult (I shouldn't think so, but am still
> asking).  I remember making sorted lists in BASIC, but I want this where the
> user clicks and chooses their preference.

Easiest thing would be to generate a static webpage from a text-file
containing all addresses in a proper format (comma separated value, eg)
and rerun the script with every change you make to the database.

But you want the user to sort (and search?) the webpage on the
fly, right?

The "database" can remain a simple text-file, that's enough for many
needs (otherwise a SQL-Database-System comes in handy. Bob Gailer had
already written this part :-).

But you must use some technology, that allows you to interact between
webpage and script.

cgi is such a thing: You're webpage gets some html-form-code and this way
the user can send informations to your cgi-script. E.g. sort-order. Now
the script can parse the address-file and sort its internal data before
putting it into on-the-fly htmlcode (In case it is not clear: you can't
sort the content on the user side [unless you make much java/javascript]).

Consult your favorite html-reference for forms and Python's Library
Reference for the cgi-modul (It comes with some explanations). Ask tutor,
of course.

>
> Am I taking on more than I'm ready for?

don't know ;-) In case you stumble against reality you could fall back to
a static webpage, which is rather simple to write (and you can reuse code
when you make your next try with an on-the-fly website).

Michael

  I like challenges, but must have a
> bit of reality in check, also.
>
> Billie
>
>
>
>