当前位置: 首页>>代码示例>>Python>>正文


Python db.create_table方法代码示例

本文整理汇总了Python中south.db.db.create_table方法的典型用法代码示例。如果您正苦于以下问题:Python db.create_table方法的具体用法?Python db.create_table怎么用?Python db.create_table使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在south.db.db的用法示例。


在下文中一共展示了db.create_table方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: forwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import create_table [as 别名]
def forwards(self, orm):
        # Adding model 'Project'
        db.create_table('api_project', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('name', self.gf('django.db.models.fields.CharField')(max_length=255)),
            ('organization', self.gf('django.db.models.fields.related.ForeignKey')(related_name='project_organization', to=orm['auth.User'])),
            ('created_by', self.gf('django.db.models.fields.related.ForeignKey')(related_name='project_creator', to=orm['auth.User'])),
            ('date_created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
            ('date_modified', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
        ))
        db.send_create_signal('api', ['Project'])

        # Adding unique constraint on 'Project', fields ['name', 'organization']
        db.create_unique('api_project', ['name', 'organization_id'])

        # Adding M2M table for field projects on 'Team'
        db.create_table('api_team_projects', (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('team', models.ForeignKey(orm['api.team'], null=False)),
            ('project', models.ForeignKey(orm['api.project'], null=False))
        ))
        db.create_unique('api_team_projects', ['team_id', 'project_id']) 
开发者ID:awemulya,项目名称:kobo-predict,代码行数:24,代码来源:0002_auto__add_project__add_unique_project_name_organization.py

示例2: forwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import create_table [as 别名]
def forwards(self, orm):
        # Adding model 'IntrinsicSyntheticDecomposition'
        db.create_table(u'intrinsic_intrinsicsyntheticdecomposition', (
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('photo', self.gf('django.db.models.fields.related.OneToOneField')(related_name='intrinsic_synthetic', unique=True, to=orm['photos.Photo'])),
            ('scene_artist', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)),
            ('scene_url', self.gf('django.db.models.fields.URLField')(max_length=255, blank=True)),
            ('multilayer_exr', self.gf('django.db.models.fields.files.FileField')(max_length=255, null=True, blank=True)),
            ('md5', self.gf('django.db.models.fields.CharField')(unique=True, max_length=32)),
            ('env_thumb', self.gf('django.db.models.fields.files.ImageField')(max_length=255, null=True, blank=True)),
            ('emit_thumb', self.gf('django.db.models.fields.files.ImageField')(max_length=255, null=True, blank=True)),
            ('depth_thumb', self.gf('django.db.models.fields.files.ImageField')(max_length=255, null=True, blank=True)),
            ('normal_thumb', self.gf('django.db.models.fields.files.ImageField')(max_length=255, null=True, blank=True)),
            ('diff_col_thumb', self.gf('django.db.models.fields.files.ImageField')(max_length=255, null=True, blank=True)),
            ('diff_ind_thumb', self.gf('django.db.models.fields.files.ImageField')(max_length=255, null=True, blank=True)),
            ('diff_dir_thumb', self.gf('django.db.models.fields.files.ImageField')(max_length=255, null=True, blank=True)),
            ('gloss_col_thumb', self.gf('django.db.models.fields.files.ImageField')(max_length=255, null=True, blank=True)),
            ('gloss_ind_thumb', self.gf('django.db.models.fields.files.ImageField')(max_length=255, null=True, blank=True)),
            ('gloss_dir_thumb', self.gf('django.db.models.fields.files.ImageField')(max_length=255, null=True, blank=True)),
            ('trans_col_thumb', self.gf('django.db.models.fields.files.ImageField')(max_length=255, null=True, blank=True)),
            ('trans_ind_thumb', self.gf('django.db.models.fields.files.ImageField')(max_length=255, null=True, blank=True)),
            ('trans_dir_thumb', self.gf('django.db.models.fields.files.ImageField')(max_length=255, null=True, blank=True)),
        ))
        db.send_create_signal(u'intrinsic', ['IntrinsicSyntheticDecomposition']) 
开发者ID:seanbell,项目名称:opensurfaces,代码行数:26,代码来源:0002_auto__add_intrinsicsyntheticdecomposition.py

示例3: forwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import create_table [as 别名]
def forwards(self, orm):
        # Adding model 'Badge'
        db.create_table('badges_badge', (
            ('id', self.gf('django.db.models.fields.CharField')(max_length=255, primary_key=True)),
            ('level', self.gf('django.db.models.fields.CharField')(max_length=1)),
            ('icon', self.gf('django.db.models.fields.files.ImageField')(max_length=100)),
        ))
        db.send_create_signal('badges', ['Badge'])

        # Adding model 'BadgeToUser'
        db.create_table('badges_badgetouser', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('badge', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['badges.Badge'])),
            ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])),
            ('created', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime.now)),
        ))
        db.send_create_signal('badges', ['BadgeToUser']) 
开发者ID:fresearchgroup,项目名称:Collaboration-System,代码行数:19,代码来源:0001_initial.py

示例4: forwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import create_table [as 别名]
def forwards(self, orm):
        # Adding model 'Account'
        db.create_table(u'connected_accounts_account', (
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])),
            ('provider', self.gf('django.db.models.fields.CharField')(max_length=50)),
            ('uid', self.gf('django.db.models.fields.CharField')(max_length=255)),
            ('last_login', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
            ('date_added', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
            ('raw_token', self.gf('django.db.models.fields.TextField')()),
            ('oauth_token', self.gf('django.db.models.fields.TextField')()),
            ('oauth_token_secret', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
            ('extra_data', self.gf('jsonfield.fields.JSONField')()),
            ('expires_at', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)),
        ))
        db.send_create_signal(u'connected_accounts', ['Account']) 
开发者ID:mishbahr,项目名称:django-connected,代码行数:18,代码来源:0001_initial.py

示例5: forwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import create_table [as 别名]
def forwards(self, orm):
        # Adding model 'UserNotificationMethod'
        db.create_table('openduty_usernotificationmethod', (
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('user', self.gf('django.db.models.fields.related.ForeignKey')(related_name='notification_methods', to=orm['auth.User'])),
            ('position', self.gf('django.db.models.fields.IntegerField')()),
            ('method', self.gf('django.db.models.fields.CharField')(max_length=50)),
        ))
        db.send_create_signal(u'notification', ['UserNotificationMethod'])

        # Adding model 'ScheduledNotification'
        db.create_table('openduty_schedulednotification', (
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('notifier', self.gf('django.db.models.fields.CharField')(max_length=30)),
            ('message', self.gf('django.db.models.fields.CharField')(max_length=500)),
            ('user_to_notify', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])),
            ('send_at', self.gf('django.db.models.fields.DateTimeField')()),
            ('incident', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['openduty.Incident'])),
        ))
        db.send_create_signal(u'notification', ['ScheduledNotification']) 
开发者ID:ustream,项目名称:openduty,代码行数:22,代码来源:0001_initial.py

示例6: forwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import create_table [as 别名]
def forwards(self, orm):
        # Deleting model 'ScagLandUseDefinition'
        db.delete_table(u'main_scaglandusedefinition')

        # Deleting model 'ScagLandUse'
        db.delete_table(u'main_scaglanduse')

        # Adding model 'ScagDmLandUseDefinition'
        db.create_table(u'main_scagdmlandusedefinition', (
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('land_use_description', self.gf('django.db.models.fields.CharField')(max_length=100, null=True, blank=True)),
            ('land_use_type', self.gf('django.db.models.fields.CharField')(max_length=100, null=True, blank=True)),
            ('land_use', self.gf('django.db.models.fields.IntegerField')()),
        ))
        db.send_create_signal('main', ['ScagDmLandUseDefinition'])

        # Adding model 'ScagDmLandUse'
        db.create_table(u'main_scagdmlanduse', (
            (u'builtform_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['main.BuiltForm'], unique=True, primary_key=True)),
            ('land_use_definition', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['main.ScagDmLandUseDefinition'])),
        ))
        db.send_create_signal('main', ['ScagDmLandUse']) 
开发者ID:CalthorpeAnalytics,项目名称:urbanfootprint,代码行数:24,代码来源:0009_auto__del_scaglandusedefinition__del_scaglanduse__add_scagdmlandusedef.py

示例7: backwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import create_table [as 别名]
def backwards(self, orm):
        # Adding model 'ScagLandUseDefinition'
        db.create_table(u'main_scaglandusedefinition', (
            ('land_use_description', self.gf('django.db.models.fields.CharField')(max_length=100, null=True, blank=True)),
            ('land_use_type', self.gf('django.db.models.fields.CharField')(max_length=100, null=True, blank=True)),
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('land_use', self.gf('django.db.models.fields.IntegerField')()),
        ))
        db.send_create_signal('main', ['ScagLandUseDefinition'])

        # Adding model 'ScagLandUse'
        db.create_table(u'main_scaglanduse', (
            (u'builtform_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['main.BuiltForm'], unique=True, primary_key=True)),
            ('land_use_definition', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['main.ScagLandUseDefinition'])),
        ))
        db.send_create_signal('main', ['ScagLandUse'])

        # Deleting model 'ScagDmLandUseDefinition'
        db.delete_table(u'main_scagdmlandusedefinition')

        # Deleting model 'ScagDmLandUse'
        db.delete_table(u'main_scagdmlanduse') 
开发者ID:CalthorpeAnalytics,项目名称:urbanfootprint,代码行数:24,代码来源:0009_auto__del_scaglandusedefinition__del_scaglanduse__add_scagdmlandusedef.py

示例8: forwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import create_table [as 别名]
def forwards(self, orm):
        # Adding model 'Event'
        db.create_table(u'socialnetwork_event', (
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('event', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['backoffice.Event'])),
            ('name', self.gf('django.db.models.fields.CharField')(max_length=10)),
            ('sn_id', self.gf('django.db.models.fields.CharField')(max_length=30)),
        ))
        db.send_create_signal(u'socialnetwork', ['Event'])

        # Adding unique constraint on 'Event', fields ['event', 'name']
        db.create_unique(u'socialnetwork_event', ['event_id', 'name'])

        # Adding model 'EventLog'
        db.create_table(u'socialnetwork_eventlog', (
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('eventlog', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['backoffice.EventLog'])),
            ('name', self.gf('django.db.models.fields.CharField')(max_length=10)),
            ('sn_id', self.gf('django.db.models.fields.CharField')(max_length=30)),
        ))
        db.send_create_signal(u'socialnetwork', ['EventLog'])

        # Adding unique constraint on 'EventLog', fields ['eventlog', 'name']
        db.create_unique(u'socialnetwork_eventlog', ['eventlog_id', 'name']) 
开发者ID:Gandi,项目名称:baobab,代码行数:26,代码来源:0001_initial.py

示例9: forwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import create_table [as 别名]
def forwards(self, orm):
        # Adding model 'SignupCode'
        db.create_table(u'authemail_signupcode', (
            ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['accounts.MyUser'])),
            ('code', self.gf('django.db.models.fields.CharField')(max_length=40, primary_key=True)),
            ('created_at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
            ('ipaddr', self.gf('django.db.models.fields.GenericIPAddressField')(max_length=39)),
        ))
        db.send_create_signal(u'authemail', ['SignupCode'])

        # Adding model 'PasswordResetCode'
        db.create_table(u'authemail_passwordresetcode', (
            ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['accounts.MyUser'])),
            ('code', self.gf('django.db.models.fields.CharField')(max_length=40, primary_key=True)),
            ('created_at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
        ))
        db.send_create_signal(u'authemail', ['PasswordResetCode']) 
开发者ID:celiao,项目名称:django-rest-authemail,代码行数:19,代码来源:0001_initial.py

示例10: forwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import create_table [as 别名]
def forwards(self, orm):
        # Adding model 'Feedback'
        db.create_table(u'htk_feedback', (
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('site', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['sites.Site'])),
            ('user', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='feedback', null=True, to=orm['auth.User'])),
            ('name', self.gf('django.db.models.fields.CharField')(max_length=100, null=True, blank=True)),
            ('comment', self.gf('django.db.models.fields.CharField')(max_length=2000, null=True, blank=True)),
            ('email', self.gf('django.db.models.fields.EmailField')(max_length=100, null=True, blank=True)),
            ('uri', self.gf('django.db.models.fields.CharField')(max_length=200, null=True, blank=True)),
            ('processed', self.gf('django.db.models.fields.BooleanField')(default=False)),
            ('needs_followup', self.gf('django.db.models.fields.BooleanField')(default=True)),
            ('date_created', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime.now)),
        ))
        db.send_create_signal('htk', ['Feedback'])

        # Adding model 'PrelaunchSignup'
        db.create_table(u'htk_prelaunchsignup', (
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('site', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['sites.Site'])),
            ('email', self.gf('django.db.models.fields.EmailField')(max_length=75, null=True, blank=True)),
            ('date_created', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime.now)),
        ))
        db.send_create_signal('htk', ['PrelaunchSignup']) 
开发者ID:hacktoolkit,项目名称:django-htk,代码行数:26,代码来源:0001_initial.py

示例11: forwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import create_table [as 别名]
def forwards(self, orm):
        # Adding model 'HTKShortUrl'
        db.create_table(u'htk_htkshorturl', (
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('url', self.gf('django.db.models.fields.CharField')(max_length=256)),
            ('creator', self.gf('django.db.models.fields.related.ForeignKey')(related_name='short_urls', on_delete=models.SET_DEFAULT, default=None, to=orm['auth.User'], blank=True, null=True)),
            ('created_on', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime(2015, 2, 21, 0, 0), auto_now_add=True, blank=True)),
        ))
        db.send_create_signal('htk', ['HTKShortUrl'])

        # Adding model 'HTKShortUrlAccess'
        db.create_table(u'htk_htkshorturlaccess', (
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('url', self.gf('django.db.models.fields.related.ForeignKey')(related_name='accesses', to=orm['htk.HTKShortUrl'])),
            ('timestamp', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
            ('user', self.gf('django.db.models.fields.related.ForeignKey')(default=None, to=orm['auth.User'], null=True, on_delete=models.SET_DEFAULT, blank=True)),
            ('user_agent', self.gf('django.db.models.fields.CharField')(max_length=256, blank=True)),
            ('user_ip', self.gf('django.db.models.fields.CharField')(max_length=15, blank=True)),
            ('referrer', self.gf('django.db.models.fields.CharField')(max_length=256, blank=True)),
        ))
        db.send_create_signal('htk', ['HTKShortUrlAccess']) 
开发者ID:hacktoolkit,项目名称:django-htk,代码行数:23,代码来源:0003_auto__add_htkshorturl__add_htkshorturlaccess.py

示例12: forwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import create_table [as 别名]
def forwards(self, orm):
        # Adding model 'Flowbit'
        db.create_table(u'rules_flowbit', (
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('name', self.gf('django.db.models.fields.CharField')(max_length=100)),
            ('set', self.gf('django.db.models.fields.BooleanField')(default=False)),
            ('isset', self.gf('django.db.models.fields.BooleanField')(default=False)),
            ('enable', self.gf('django.db.models.fields.BooleanField')(default=True)),
            ('source', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['rules.Source'])),
        ))
        db.send_create_signal(u'rules', ['Flowbit'])

        # Adding M2M table for field flowbits on 'Rule'
        m2m_table_name = db.shorten_name(u'rules_rule_flowbits')
        db.create_table(m2m_table_name, (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('rule', models.ForeignKey(orm[u'rules.rule'], null=False)),
            ('flowbit', models.ForeignKey(orm[u'rules.flowbit'], null=False))
        ))
        db.create_unique(m2m_table_name, ['rule_id', 'flowbit_id']) 
开发者ID:StamusNetworks,项目名称:scirius,代码行数:22,代码来源:0006_auto__add_flowbit.py

示例13: forwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import create_table [as 别名]
def forwards(self, orm):
        # Adding model 'Organization'
        db.create_table(u'crowdataapp_organization', (
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('name', self.gf('django.db.models.fields.CharField')(max_length='128')),
            ('description', self.gf('django.db.models.fields.TextField')()),
        ))
        db.send_create_signal(u'crowdataapp', ['Organization'])

        # Adding M2M table for field users on 'Organization'
        m2m_table_name = db.shorten_name(u'crowdataapp_organization_users')
        db.create_table(m2m_table_name, (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('organization', models.ForeignKey(orm[u'crowdataapp.organization'], null=False)),
            ('user', models.ForeignKey(orm[u'auth.user'], null=False))
        ))
        db.create_unique(m2m_table_name, ['organization_id', 'user_id'])

        # Adding field 'DocumentSetFormEntry.organization'
        db.add_column(u'crowdataapp_documentsetformentry', 'organization',
                      self.gf('django.db.models.fields.related.ForeignKey')(to=orm['crowdataapp.Organization'], null=True, blank=True),
                      keep_default=False)

        # Adding field 'UserProfile.current_organization'
        db.add_column(u'crowdataapp_userprofile', 'current_organization',
                      self.gf('django.db.models.fields.related.ForeignKey')(to=orm['crowdataapp.Organization'], null=True, blank=True),
                      keep_default=False) 
开发者ID:crowdata,项目名称:crowdata,代码行数:29,代码来源:0028_auto__add_organization__add_field_documentsetformentry_organization__a.py

示例14: forwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import create_table [as 别名]
def forwards(self, orm):
        # Adding model 'DocumentSetRankingDefinition'
        db.create_table(u'crowdataapp_documentsetrankingdefinition', (
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('document_set', self.gf('django.db.models.fields.related.ForeignKey')(related_name='ranking_documents', to=orm['crowdataapp.DocumentSet'])),
            ('name', self.gf('django.db.models.fields.CharField')(max_length=256, null=True)),
            ('field', self.gf('django.db.models.fields.related.ForeignKey')(related_name='fields', to=orm['crowdataapp.DocumentSetFormField'])),
            ('grouping_function', self.gf('django.db.models.fields.CharField')(default='SUM', max_length=10)),
        ))
        db.send_create_signal(u'crowdataapp', ['DocumentSetRankingDefinition']) 
开发者ID:crowdata,项目名称:crowdata,代码行数:12,代码来源:0011_auto__add_documentsetrankingdefinition.py

示例15: forwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import create_table [as 别名]
def forwards(self, orm):
        # Adding model 'UserProfile'
        db.create_table(u'crowdataapp_userprofile', (
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], unique=True)),
            ('name', self.gf('django.db.models.fields.CharField')(max_length='128')),
            ('country', self.gf('django_countries.fields.CountryField')(max_length=2, null=True)),
            ('show_in_leaderboard', self.gf('django.db.models.fields.BooleanField')(default=False)),
        ))
        db.send_create_signal(u'crowdataapp', ['UserProfile']) 
开发者ID:crowdata,项目名称:crowdata,代码行数:12,代码来源:0010_auto__add_userprofile.py


注:本文中的south.db.db.create_table方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。