예제 #1
0
    Field('role', 'string', length = 100, notnull = True, unique = True),
    Field('description', length = 255, default = ''),
    format = '%(role)s')

auth.settings.table_membership = db.define_table(
    auth.settings.table_membership_name,
    Field('user_id', db.user),
    Field('group_id', db.user_group),
    primarykey = ['user_id', 'group_id'])

###############################################################################
auth.define_tables(username = True)
###############################################################################
if current.auth_type == AUTH_TYPE_LDAP :
    from gluon.contrib.login_methods.pam_auth import pam_auth
    auth.settings.login_methods = [pam_auth()]
    auth.settings.login_onaccept = [login_ldap_callback]
else:
    auth.settings.login_onaccept = [login_callback]
    auth.settings.registration_requires_approval = True
###############################################################################

db.define_table('vlan',
    Field('name', 'string', length = 30, notnull = True, unique = True),
    Field('vlan_tag', 'string', length = 30, notnull = True),
    Field('vlan_addr', 'string', length = 15, notnull = True, requires=IS_IPV4()),
    format = '%(name)s')

db.define_table('security_domain',
    Field('name', 'string', length = 30, notnull = True, unique = True, label='Name'),
    Field('vlan', 'reference vlan', unique = True),
예제 #2
0
파일: db.py 프로젝트: nisha-goyal/newbaadal
    auth.settings.table_group_name,
    Field('role', 'string',length = 100,notnull = True, unique = True),
    Field('description', length = 255, default = ''))

auth.settings.table_membership = db.define_table(
    auth.settings.table_membership_name,
    Field('user_id', db.user),
    Field('group_id', db.user_group),
    primarykey = ['user_id', 'group_id'])

###############################################################################
auth.define_tables(username = True)
###############################################################################
if current.auth_type == 'ldap':
    from gluon.contrib.login_methods.pam_auth import pam_auth
    auth.settings.login_methods = [pam_auth()]
    auth.settings.login_onaccept = [login_ldap_callback]  
else:
    auth.settings.login_onaccept = [login_callback]  
###############################################################################

db.define_table('host',
    Field('host_ip', 'string',length = 15,notnull = True, unique = True),
    Field('host_name', 'string',length = 100,notnull = True, unique = True),
    Field('mac_addr', 'string',length = 100,notnull = True, unique = True),
    Field('HDD', 'integer'),
    Field('CPUs', 'integer'),
    Field('RAM', 'integer'),
    Field("category","string"),
    Field('status', 'integer'),
    Field('vm_count', 'integer', default = 0))