本文整理汇总了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']))
示例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']))
示例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))
示例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))
示例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))
示例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))
示例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')())
示例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'}))
示例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))
示例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')())
示例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')())