Data structures in python: maintaining filesystem structure within a database
I suggest to follow the Unix way. Each file is considered a stream of bytes, nothing more, nothing less. Each file is technically represented by a single structure called i-node (index node) that keeps all information related to the physical stream of the data (including attributes, ownership,...). 
The i-node does not contain anything about the readable name. Each i-node is given a unique number (forever) that acts for the file as its technical name. You can use similar number to give the stream of bytes in database its unique identification. The i-nodes are stored on the disk in a separate contiguous section -- think about the array of i-node structures (in the abstract sense), or about the separate table in the database.
Back to the file. This way it is represented by unique number. For your database representation, the number will be the unique key. If you need the other i-node information (file attributes), you can add the other columns to the table. One column will be of the blob type, and it will represent the content of the file (the stream of bytes). For AJAX, I gues that the files will be rather small; so, you should not have a problem with the size limits of the blob.
So far, the files are stored in as a flat structure (as the physical disk is, and as the relational database is).
The structure of directory names and file names of the files are kept separately, in another files (kept in the same structure, together with the other files, represented also by their i-node). Basically, the directory file captures tuples (bare_name, i-node number). (This way the hard links are implemented in Unix -- two names are paired with the same i-none number.) The root directory file has to have a fixed technical identification -- i.e. the reserved i-node number.
I have a data organization issue.  I'm working on a client/server project where the server must maintain a copy of the client's filesystem structure inside of a database that resides on the server.  The idea is to display the filesystem contents on the server side in an AJAX-ified web interface.  Right now I'm simply uploading a list of files to the database where the files are dumped sequentially.  The problem is how to recapture the filesystem structure on the server end once they're in the database.  It doesn't seem feasible to reconstruct the parent->child structure on the server end by iterating through a huge list of files.  However, when the file objects have no references to each other, that seems to be the only option.
I'm not entirely sure how to handle this.  As near as I can tell, I would need to duplicate some type of filesystem data structure on the server side (in a Btree perhaps?) with objects maintaining pointers to their parents and/or children.  I'm wondering if anyone has had any similar past experiences they could share, or maybe some helpful resources to point me in the right direction.