Created
November 22, 2010 13:24
-
-
Save primalmotion/709965 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class TNArchipelPermissionCenter: | |
| class TNArchipelUser (SQLObject): | |
| class sqlmeta: | |
| table = "TNArchipelUser" | |
| _connection = None | |
| name = StringCol(alternateID=True) | |
| roles = RelatedJoin('TNArchipelRole') | |
| permissions = RelatedJoin('TNArchipelPermission') | |
| class TNArchipelRole (SQLObject): | |
| class sqlmeta: | |
| table = "TNArchipelRole" | |
| _connection = None | |
| name = StringCol(alternateID=True) | |
| users = RelatedJoin('TNArchipelUser') | |
| permissions = RelatedJoin('TNArchipelPermission') | |
| class TNArchipelPermission (SQLObject): | |
| class sqlmeta: | |
| table = "TNArchipelPermission" | |
| _connection = None | |
| name = StringCol(alternateID=True) | |
| defaultValue = IntCol() | |
| users = RelatedJoin('TNArchipelUser') | |
| roles = RelatedJoin('TNArchipelRole') | |
| def __init__(self, database_file, root_admin): | |
| self.root_admin = root_admin | |
| connection_string = 'sqlite://%s' % database_file | |
| self.connection = connectionForURI(connection_string) | |
| self.TNArchipelRole._connection = self.connection | |
| self.TNArchipelRole.createTable(ifNotExists=True) | |
| self.TNArchipelUser._connection = self.connection | |
| self.TNArchipelUser.createTable(ifNotExists=True) | |
| self.TNArchipelPermission._connection = self.connection | |
| self.TNArchipelPermission.createTable(ifNotExists=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment