comparison roundup/templates/classic/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.7 2001-08-07 00:24:43 richard Exp $ 18 # $Id: dbinit.py,v 1.8 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, cgi_client, mailgw 23 from roundup import roundupdb
24 import select_db 24 import select_db
25 25
26 from roundup.roundupdb import Class, FileClass 26 from roundup.roundupdb import Class, FileClass
27 27
28 class Database(roundupdb.Database, select_db.Database): 28 class Database(roundupdb.Database, select_db.Database):
43 43
44 def open(name=None): 44 def open(name=None):
45 ''' as from the roundupdb method openDB 45 ''' as from the roundupdb method openDB
46 46
47 ''' 47 '''
48 from roundup.hyperdb import String, Date, Link, Multilink 48 from roundup.hyperdb import String, Password, Date, Link, Multilink
49 49
50 # open the database 50 # open the database
51 db = Database(instance_config.DATABASE, name) 51 db = Database(instance_config.DATABASE, name)
52 52
53 # Now initialise the schema. Must do this each time. 53 # Now initialise the schema. Must do this each time.
62 keyword = Class(db, "keyword", 62 keyword = Class(db, "keyword",
63 name=String()) 63 name=String())
64 keyword.setkey("name") 64 keyword.setkey("name")
65 65
66 user = Class(db, "user", 66 user = Class(db, "user",
67 username=String(), password=String(), 67 username=String(), password=Password(),
68 address=String(), realname=String(), 68 address=String(), realname=String(),
69 phone=String(), organisation=String()) 69 phone=String(), organisation=String())
70 user.setkey("username") 70 user.setkey("username")
71 71
72 msg = FileClass(db, "msg", 72 msg = FileClass(db, "msg",
123 123
124 db.close() 124 db.close()
125 125
126 # 126 #
127 # $Log: not supported by cvs2svn $ 127 # $Log: not supported by cvs2svn $
128 # Revision 1.7 2001/08/07 00:24:43 richard
129 # stupid typo
130 #
128 # Revision 1.6 2001/08/07 00:15:51 richard 131 # Revision 1.6 2001/08/07 00:15:51 richard
129 # Added the copyright/license notice to (nearly) all files at request of 132 # Added the copyright/license notice to (nearly) all files at request of
130 # Bizar Software. 133 # Bizar Software.
131 # 134 #
132 # Revision 1.5 2001/08/02 06:38:17 richard 135 # Revision 1.5 2001/08/02 06:38:17 richard

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