[Tutor] Datamodelling

charlie@begeistert.org charlie@begeistert.org
Tue Mar 11 05:46:22 2003


On 2003-03-09 at 23:30:30 [+0100], Alan Gauld wrote:
> > I was thinking of using shelve but I'm not sure about keys or doing 
>  
> Shelve would seem a reasonable starting point. Think of it as a single 
> table database!
>  
> You can use multiple shelves but then you have to do the joins manually.

How do I deal with "fixed" columns? Shelve won't enforce this for me, will 
it? I assume I just have to do this in the script.

I've done my development and everything works fine until I try it on the 
server: I get a permissions error

Traceback (most recent call last): 
File "...", line 109, in ? id = begeistert.store_addr(t_reg, 'register') 
File "/_web/begeistert.org/cgi-bin/begeistert.py", line 12, in store_addr 
shelf = shelve.open("../" + db, 'c') File "/usr/lib/python2.1/shelve.py", 
line 158, in open return DbfilenameShelf(filename, flag) File 
"/usr/lib/python2.1/shelve.py", line 148, in __init__ Shelf.__init__(self, 
anydbm.open(filename, flag)) File "/usr/lib/python2.1/anydbm.py", line 86, 
in open return mod.open(file, flag, mode) File 
"/usr/lib/python2.1/dbhash.py", line 16, in open return 
bsddb.hashopen(file, flag, mode) bsddb.error: (13, 'Permission denied')

Does anybody know how to work around this? It looks like my script isn't 
allowed to create files.

Charlie