Mercurial > p > roundup > code
comparison roundup/templates/minimal/dbinit.py @ 1235:7441653e5330
added hook for external password validation, and some more docco
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Thu, 26 Sep 2002 23:59:08 +0000 |
| parents | 0ef27b438916 |
| children | 5a44e8cf1a62 |
comparison
equal
deleted
inserted
replaced
| 1234:c0a3b1c49ef7 | 1235:7441653e5330 |
|---|---|
| 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.1 2002-09-26 04:15:07 richard Exp $ | 18 # $Id: dbinit.py,v 1.2 2002-09-26 23:59:08 richard Exp $ |
| 19 | 19 |
| 20 import os | 20 import os |
| 21 | 21 |
| 22 import config | 22 import config |
| 23 from select_db import Database, Class, FileClass, IssueClass | 23 from select_db import Database, Class, FileClass, IssueClass |
| 40 | 40 |
| 41 # Note: roles is a comma-separated string of Role names | 41 # Note: roles is a comma-separated string of Role names |
| 42 user = Class(db, "user", username=String(), password=Password(), | 42 user = Class(db, "user", username=String(), password=Password(), |
| 43 address=String(), alternate_addresses=String(), roles=String()) | 43 address=String(), alternate_addresses=String(), roles=String()) |
| 44 user.setkey("username") | 44 user.setkey("username") |
| 45 | |
| 46 # add any additional database schema configuration here | |
| 45 | 47 |
| 46 # | 48 # |
| 47 # SECURITY SETTINGS | 49 # SECURITY SETTINGS |
| 48 # | 50 # |
| 49 # new permissions for this schema | 51 # new permissions for this schema |
| 98 user = db.getclass('user') | 100 user = db.getclass('user') |
| 99 user.create(username="admin", password=adminpw, | 101 user.create(username="admin", password=adminpw, |
| 100 address=config.ADMIN_EMAIL, roles='Admin') | 102 address=config.ADMIN_EMAIL, roles='Admin') |
| 101 user.create(username="anonymous", roles='Anonymous') | 103 user.create(username="anonymous", roles='Anonymous') |
| 102 | 104 |
| 105 # add any additional database create steps here - but only if you | |
| 106 # haven't initialised the database with the admin "initialise" command | |
| 107 | |
| 103 db.commit() | 108 db.commit() |
| 104 | 109 |
| 105 # vim: set filetype=python ts=4 sw=4 et si | 110 # vim: set filetype=python ts=4 sw=4 et si |
| 106 | 111 |
