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


Python db.alter_column方法代码示例

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


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

示例1: forwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import alter_column [as 别名]
def forwards(self, orm):
        # Adding model 'LocalDataSource'
        db.create_table(u'main_localdatasource', (
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('datasource', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['main.DataSource'], unique=True, null=True)),
            ('pendingdatasource', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['main.PendingDataSource'], unique=True, null=True)),
            ('json', self.gf('jsonfield.fields.JSONField')(null=True)),
        ))
        db.send_create_signal(u'main', ['LocalDataSource'])

        # Adding field 'PendingDataSource.user'
        db.add_column(u'main_pendingdatasource', 'user',
                      self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True),
                      keep_default=False)


        # Changing field 'PendingDataSource.params_json'
        db.alter_column(u'main_pendingdatasource', 'params_json', self.gf('jsonfield.fields.JSONField')())

        # Changing field 'Event.details'
        db.alter_column(u'main_event', 'details', self.gf('django.db.models.fields.CharField')(max_length=256, null=True)) 
开发者ID:Polychart,项目名称:builder,代码行数:23,代码来源:0003_auto__add_localdatasource__add_field_pendingdatasource_user__chg_field.py

示例2: forwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import alter_column [as 别名]
def forwards(self, orm):
        
        # Adding model 'UserInfo'
        db.create_table('canvas_userinfo', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('user', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['auth.User'], unique=True)),
            ('free_invites', self.gf('django.db.models.fields.IntegerField')(default=0)),
        ))
        db.send_create_signal('canvas', ['UserInfo'])

        # Adding model 'FacebookUser'
        db.create_table('canvas_facebookuser', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('user', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['auth.User'], unique=True)),
            ('fb_uid', self.gf('django.db.models.fields.BigIntegerField')(unique=True)),
        ))
        db.send_create_signal('canvas', ['FacebookUser'])

        # Changing field 'InviteCode.code'
        db.alter_column('canvas_invitecode', 'code', self.gf('django.db.models.fields.CharField')(unique=True, max_length=32)) 
开发者ID:canvasnetworks,项目名称:canvas,代码行数:22,代码来源:0048_auto__add_userinfo__add_facebookuser__chg_field_invitecode_code.py

示例3: forwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import alter_column [as 别名]
def forwards(self, orm):

        # Changing field 'DocumentSetRankingDefinition.magnitude_field'
        db.alter_column(u'crowdataapp_documentsetrankingdefinition', 'magnitude_field_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, to=orm['crowdataapp.DocumentSetFormField'])) 
开发者ID:crowdata,项目名称:crowdata,代码行数:6,代码来源:0014_auto__chg_field_documentsetrankingdefinition_magnitude_field.py

示例4: backwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import alter_column [as 别名]
def backwards(self, orm):

        # Changing field 'DocumentSetRankingDefinition.magnitude_field'
        db.alter_column(u'crowdataapp_documentsetrankingdefinition', 'magnitude_field_id', self.gf('django.db.models.fields.related.ForeignKey')(default=1, to=orm['crowdataapp.DocumentSetFormField'])) 
开发者ID:crowdata,项目名称:crowdata,代码行数:6,代码来源:0014_auto__chg_field_documentsetrankingdefinition_magnitude_field.py

示例5: forwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import alter_column [as 别名]
def forwards(self, orm):

        # Changing field 'DocumentSetFormEntry.document'
        db.alter_column(u'crowdataapp_documentsetformentry', 'document_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, to=orm['crowdataapp.Document'])) 
开发者ID:crowdata,项目名称:crowdata,代码行数:6,代码来源:0004_auto__chg_field_documentsetformentry_document.py

示例6: backwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import alter_column [as 别名]
def backwards(self, orm):

        # Changing field 'DocumentSetFormEntry.document'
        db.alter_column(u'crowdataapp_documentsetformentry', 'document_id', self.gf('django.db.models.fields.related.ForeignKey')(default=None, to=orm['crowdataapp.Document'])) 
开发者ID:crowdata,项目名称:crowdata,代码行数:6,代码来源:0004_auto__chg_field_documentsetformentry_document.py

示例7: forwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import alter_column [as 别名]
def forwards(self, orm):

        # Changing field 'DocumentSetRankingDefinition.name'
        db.alter_column(u'crowdataapp_documentsetrankingdefinition', 'name', self.gf('django.db.models.fields.CharField')(default='', max_length=256)) 
开发者ID:crowdata,项目名称:crowdata,代码行数:6,代码来源:0013_auto__chg_field_documentsetrankingdefinition_name.py

示例8: forwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import alter_column [as 别名]
def forwards(self, orm):

        # Changing field 'CanonicalFieldEntryLabel.value'
        db.alter_column(u'crowdataapp_canonicalfieldentrylabel', 'value', self.gf('django.db.models.fields.CharField')(max_length=2000, null=True)) 
开发者ID:crowdata,项目名称:crowdata,代码行数:6,代码来源:0025_auto__chg_field_canonicalfieldentrylabel_value.py

示例9: backwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import alter_column [as 别名]
def backwards(self, orm):

        # Changing field 'CanonicalFieldEntryLabel.value'
        db.alter_column(u'crowdataapp_canonicalfieldentrylabel', 'value', self.gf('django.db.models.fields.CharField')(max_length=50, null=True)) 
开发者ID:crowdata,项目名称:crowdata,代码行数:6,代码来源:0025_auto__chg_field_canonicalfieldentrylabel_value.py

示例10: forwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import alter_column [as 别名]
def forwards(self, orm):

        # Changing field 'Document.stored_validity_rate'
        db.alter_column(u'crowdataapp_document', 'stored_validity_rate', self.gf('django.db.models.fields.DecimalField')(max_digits=3, decimal_places=2)) 
开发者ID:crowdata,项目名称:crowdata,代码行数:6,代码来源:0009_auto__chg_field_document_stored_validity_rate.py

示例11: backwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import alter_column [as 别名]
def backwards(self, orm):

        # Changing field 'Document.stored_validity_rate'
        db.alter_column(u'crowdataapp_document', 'stored_validity_rate', self.gf('django.db.models.fields.IntegerField')()) 
开发者ID:crowdata,项目名称:crowdata,代码行数:6,代码来源:0009_auto__chg_field_document_stored_validity_rate.py

示例12: forwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import alter_column [as 别名]
def forwards(self, orm):

        # Changing field 'Project.metadata'
        db.alter_column(u'api_project', 'metadata', self.gf('jsonfield.fields.JSONField')(default={'category': 'none'})) 
开发者ID:awemulya,项目名称:kobo-predict,代码行数:6,代码来源:0007_auto__chg_field_project_metadata.py

示例13: backwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import alter_column [as 别名]
def backwards(self, orm):

        # Changing field 'Project.metadata'
        db.alter_column(u'api_project', 'metadata', self.gf('jsonfield.fields.JSONField')(null=True)) 
开发者ID:awemulya,项目名称:kobo-predict,代码行数:6,代码来源:0007_auto__chg_field_project_metadata.py

示例14: forwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import alter_column [as 别名]
def forwards(self, orm):
        
        # Changing field 'StatsCount.value'
        db.alter_column('stats_statscount', 'value', self.gf('django.db.models.fields.IntegerField')()) 
开发者ID:awemulya,项目名称:kobo-predict,代码行数:6,代码来源:0002_auto__chg_field_statscount_value.py

示例15: backwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import alter_column [as 别名]
def backwards(self, orm):
        
        # Changing field 'StatsCount.value'
        db.alter_column('stats_statscount', 'value', self.gf('django.db.models.fields.SmallIntegerField')()) 
开发者ID:awemulya,项目名称:kobo-predict,代码行数:6,代码来源:0002_auto__chg_field_statscount_value.py


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