當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。