comparison roundup/templates/extended/dbinit.py @ 270:a4241ddd22d7

Added the Password property type. See "pydoc roundup.password" for implementation details. Have updated some of the documentation too.
author Richard Jones <richard@users.sourceforge.net>
date Tue, 09 Oct 2001 07:25:59 +0000
parents 18134bffab37
children 8cd545738d8e
comparison
equal deleted inserted replaced
269:82cfd78f3c4e 270:a4241ddd22d7
13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
17 # 17 #
18 # $Id: dbinit.py,v 1.11 2001-08-07 00:24:43 richard Exp $ 18 # $Id: dbinit.py,v 1.12 2001-10-09 07:25:59 richard Exp $
19 19
20 import os 20 import os
21 21
22 import instance_config 22 import instance_config
23 from roundup import roundupdb 23 from roundup import roundupdb
24 import select_db 24 import select_db
25
25 from roundup.roundupdb import Class, FileClass 26 from roundup.roundupdb import Class, FileClass
26 27
27 class Database(roundupdb.Database, select_db.Database): 28 class Database(roundupdb.Database, select_db.Database):
28 ''' Creates a hybrid database from: 29 ''' Creates a hybrid database from:
29 . the selected database back-end from select_db 30 . the selected database back-end from select_db
42 43
43 def open(name=None): 44 def open(name=None):
44 ''' as from the roundupdb method openDB 45 ''' as from the roundupdb method openDB
45 46
46 ''' 47 '''
47 from roundup.hyperdb import String, Date, Link, Multilink 48 from roundup.hyperdb import String, Password, Date, Link, Multilink
48 49
49 # open the database 50 # open the database
50 db = Database(instance_config.DATABASE, name) 51 db = Database(instance_config.DATABASE, name)
51 52
52 # Now initialise the schema. Must do this each time. 53 # Now initialise the schema. Must do this each time.
58 name=String(), order=String()) 59 name=String(), order=String())
59 stat.setkey("name") 60 stat.setkey("name")
60 61
61 keywords = Class(db, "keyword", 62 keywords = Class(db, "keyword",
62 name=String()) 63 name=String())
64 keywords.setkey("name")
63 65
64 user = Class(db, "user", 66 user = Class(db, "user",
65 username=String(), password=String(), 67 username=String(), password=Password(),
66 address=String(), realname=String(), 68 address=String(), realname=String(),
67 phone=String(), organisation=String()) 69 phone=String(), organisation=String())
68 user.setkey("username") 70 user.setkey("username")
69 71
70 msg = FileClass(db, "msg", 72 msg = FileClass(db, "msg",
171 173
172 db.close() 174 db.close()
173 175
174 # 176 #
175 # $Log: not supported by cvs2svn $ 177 # $Log: not supported by cvs2svn $
178 # Revision 1.11 2001/08/07 00:24:43 richard
179 # stupid typo
180 #
176 # Revision 1.10 2001/08/07 00:15:51 richard 181 # Revision 1.10 2001/08/07 00:15:51 richard
177 # Added the copyright/license notice to (nearly) all files at request of 182 # Added the copyright/license notice to (nearly) all files at request of
178 # Bizar Software. 183 # Bizar Software.
179 # 184 #
180 # Revision 1.9 2001/08/02 06:38:17 richard 185 # Revision 1.9 2001/08/02 06:38:17 richard

Roundup Issue Tracker: http://roundup-tracker.org/