database design help

Brian Blais bblais at bryant.edu
Sat Jun 23 18:27:48 EDT 2007


Hello,

I am trying to design a system for people to submit a series of documents to a
project.  I want users to have the ability to submit updates to any documents, so
that there should be a history (or sequence) for each document.  I think in terms of
python data structures, so the relational database organization is not all that clear
to me (so I am trying to learn it!).  I am using buzhug, but the concept should be
the same in any rdb.

So my conceptual structure would look something like:

project1:
   document 1, document 1a, document 1b
   document 2
   document 3, document 3a

project 2:
   document 4, document 4a

etc...

I want to be able to query the history of any single document, so I can get a list of
document 1, 1a, and 1b.  or document 3  and 3a, etc...

So I have something like this (omitting a few lines, for clarity) to set up the
record structure:

     users.create(('name',str),
             ('email',str))

     project.create( ('description',str),
             ('label',str),
             ('creation_date',date),
             ('submitter',users))

     documents.create(('filename',str),
             ('submit',date),
             ('submitter',users),
             ('type',str),
             ('project',project))

with this structure, I can get a project with a series of documents, but each
document doesn't have a history.   My first thought (with Python data structures) is
to use a list, but that's not an rdb concept.  Do I make something like:

    document_sequences.create(('name',str),('project',project))

and then change documents so that it contains not only a project field, but a
document_sequence field?   Am I thinking about this correctly?

Is there a resource I can read that goes through any of this?


		thanks,


			Brian Blais




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

              bblais at bryant.edu
              http://web.bryant.edu/~bblais




More information about the Python-list mailing list