help with user configuration

sp00fd sp00fdNOspSPAM at yahoo.com.invalid
Fri Aug 11 11:37:34 EDT 2000


I've created a program "SICKnotes" (cgi/db based, find it on
Freshmeat.net).  This program allows system administrators to
enter a system and it's description into a database and
then "post notes" to that system after making changes or
whatever.  (see http://members.home.com/m.v.wilson for
screenshots and whatnot)

The problem is that my html "description" for the system is
static (i.e. Has fields like
name
mac address
ip address
etc...
)
as is the database description, and I've had a lot of people ask
me to add fields because they have 3 ip's and 3 mac addresses,
or whatever.  One guy even wanted a file upload field because
they take pictures of their equipment and he'd like that to be
in the database.  I think that this is a reasonable request
because it really should be shop specific.  Also, as an
afterthought, I added the ability to add software, disk arrays,
or tape libraries, but they are stored in the same table and use
the same html form to add.  Odd to ask for a mac address for a
software product, right?!

Anyway, on to the question, How could I go about letting the
user define what the html form should look like (preferrably
this definition would also describe how to insert entries into
the database)?  I want to make it easy to add types and whatnot,
but creating this relationship between the program, html, and
database isn't easy (for me at least).  So if someone wants to
be able to post routers, they can add their own description of
what info a router has that's important.

At first I though of creating a dictionary which might look
something like this:
system = {
         "info" : {
                  "name" : "Systems",
                  "indexby" : ("id", "subject"),
                  ...
                  }
         "fields" : {
                    1 : ("TEXT", 64, 50, "varname", "This
label", "Default value", 1),
                    2 : ("MULTIPLE", 6,
0, "vcontacts", "Contacts", "Conttable", "id", "contact"...
...

where each list defines how it should look.  So a text field
with maxlength=64, length=50, varname=how to pass this around,
label....etc.  I just can't put it all together in my head
though.  Has anyone done something similar?

I know this question is real general, but it'd be difficult to
get into specifics.  See the website screenshots if you need a
better idea of what I'm trying to do.

Basically, "How do I allow the user to create a definition
without them really knowing how to program, and how do I parse
this definition, while still remaining sane?"


-----------------------------------------------------------

Got questions?  Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com




More information about the Python-list mailing list