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


Python db.add_column方法代码示例

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


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

示例1: forwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import add_column [as 别名]
def forwards(self, orm):
        # Adding field 'Organization.logo'
        db.add_column(u'crowdataapp_organization', 'logo',
                      self.gf('django.db.models.fields.files.ImageField')(default='hola.png', max_length=100),
                      keep_default=False)

        # Adding field 'Organization.email'
        db.add_column(u'crowdataapp_organization', 'email',
                      self.gf('django.db.models.fields.EmailField')(default='email@email.com', max_length='128'),
                      keep_default=False)

        # Adding field 'Organization.twitter'
        db.add_column(u'crowdataapp_organization', 'twitter',
                      self.gf('django.db.models.fields.CharField')(max_length='128', null=True, blank=True),
                      keep_default=False)

        # Adding field 'Organization.facebook'
        db.add_column(u'crowdataapp_organization', 'facebook',
                      self.gf('django.db.models.fields.CharField')(max_length='128', null=True, blank=True),
                      keep_default=False)

        # Adding field 'Organization.url'
        db.add_column(u'crowdataapp_organization', 'url',
                      self.gf('django.db.models.fields.CharField')(max_length='128', null=True, blank=True),
                      keep_default=False) 
开发者ID:crowdata,项目名称:crowdata,代码行数:27,代码来源:0029_auto__add_field_organization_logo__add_field_organization_email__add_f.py

示例2: forwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import add_column [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

示例3: forwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import add_column [as 别名]
def forwards(self, orm):
        # Adding field 'Document.verified'
        db.add_column(u'crowdataapp_document', 'verified',
                      self.gf('django.db.models.fields.BooleanField')(default=False),
                      keep_default=False)

        # Deleting field 'DocumentSetFieldEntry.valid'
        db.delete_column(u'crowdataapp_documentsetfieldentry', 'valid')

        # Adding field 'DocumentSetFieldEntry.verified'
        db.add_column(u'crowdataapp_documentsetfieldentry', 'verified',
                      self.gf('django.db.models.fields.BooleanField')(default=False),
                      keep_default=False) 
开发者ID:crowdata,项目名称:crowdata,代码行数:15,代码来源:0017_auto__add_field_document_verified__del_field_documentsetfieldentry_val.py

示例4: backwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import add_column [as 别名]
def backwards(self, orm):
        # Deleting field 'Document.verified'
        db.delete_column(u'crowdataapp_document', 'verified')

        # Adding field 'DocumentSetFieldEntry.valid'
        db.add_column(u'crowdataapp_documentsetfieldentry', 'valid',
                      self.gf('django.db.models.fields.BooleanField')(default=False),
                      keep_default=False)

        # Deleting field 'DocumentSetFieldEntry.verified'
        db.delete_column(u'crowdataapp_documentsetfieldentry', 'verified') 
开发者ID:crowdata,项目名称:crowdata,代码行数:13,代码来源:0017_auto__add_field_document_verified__del_field_documentsetfieldentry_val.py

示例5: forwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import add_column [as 别名]
def forwards(self, orm):
        # Adding field 'DocumentSet.tosum_field'
        db.add_column(u'crowdataapp_documentset', 'tosum_field',
                      self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='tosum_fields', null=True, to=orm['crowdataapp.DocumentSetFormField']),
                      keep_default=False) 
开发者ID:crowdata,项目名称:crowdata,代码行数:7,代码来源:0027_auto__add_field_documentset_tosum_field.py

示例6: forwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import add_column [as 别名]
def forwards(self, orm):
        # Deleting field 'Document.stored_validity_rate'
        db.delete_column(u'crowdataapp_document', 'stored_validity_rate')

        # Adding field 'Document.entries_threshold_override'
        db.add_column(u'crowdataapp_document', 'entries_threshold_override',
                      self.gf('django.db.models.fields.IntegerField')(null=True),
                      keep_default=False) 
开发者ID:crowdata,项目名称:crowdata,代码行数:10,代码来源:0015_auto__del_field_document_stored_validity_rate__add_field_document_entr.py

示例7: forwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import add_column [as 别名]
def forwards(self, orm):
        # Adding field 'Organization.slug'
        db.add_column(u'crowdataapp_organization', 'slug',
                      self.gf('django_extensions.db.fields.AutoSlugField')(allow_duplicates=False, max_length=50, separator=u'-', blank=True, default='', populate_from='name', overwrite=False),
                      keep_default=False) 
开发者ID:crowdata,项目名称:crowdata,代码行数:7,代码来源:0030_auto__add_field_organization_slug.py

示例8: forwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import add_column [as 别名]
def forwards(self, orm):
        # Deleting field 'DocumentSetRankingDefinition.field'
        db.delete_column(u'crowdataapp_documentsetrankingdefinition', 'field_id')

        # Adding field 'DocumentSetRankingDefinition.label_field'
        db.add_column(u'crowdataapp_documentsetrankingdefinition', 'label_field',
                      self.gf('django.db.models.fields.related.ForeignKey')(default=1, related_name='label_fields', to=orm['crowdataapp.DocumentSetFormField']),
                      keep_default=False)

        # Adding field 'DocumentSetRankingDefinition.magnitude_field'
        db.add_column(u'crowdataapp_documentsetrankingdefinition', 'magnitude_field',
                      self.gf('django.db.models.fields.related.ForeignKey')(default=1, related_name='magnitude_fields', to=orm['crowdataapp.DocumentSetFormField']),
                      keep_default=False) 
开发者ID:crowdata,项目名称:crowdata,代码行数:15,代码来源:0012_auto__del_field_documentsetrankingdefinition_field__add_field_document.py

示例9: backwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import add_column [as 别名]
def backwards(self, orm):
        # Adding field 'DocumentSetRankingDefinition.field'
        db.add_column(u'crowdataapp_documentsetrankingdefinition', 'field',
                      self.gf('django.db.models.fields.related.ForeignKey')(default=1, related_name='fields', to=orm['crowdataapp.DocumentSetFormField']),
                      keep_default=False)

        # Deleting field 'DocumentSetRankingDefinition.label_field'
        db.delete_column(u'crowdataapp_documentsetrankingdefinition', 'label_field_id')

        # Deleting field 'DocumentSetRankingDefinition.magnitude_field'
        db.delete_column(u'crowdataapp_documentsetrankingdefinition', 'magnitude_field_id') 
开发者ID:crowdata,项目名称:crowdata,代码行数:13,代码来源:0012_auto__del_field_documentsetrankingdefinition_field__add_field_document.py

示例10: forwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import add_column [as 别名]
def forwards(self, orm):
        # Adding field 'DocumentSetRankingDefinition.amount_rows_on_home'
        db.add_column(u'crowdataapp_documentsetrankingdefinition', 'amount_rows_on_home',
                      self.gf('django.db.models.fields.IntegerField')(default=10, null=True),
                      keep_default=False) 
开发者ID:crowdata,项目名称:crowdata,代码行数:7,代码来源:0021_auto__add_field_documentsetrankingdefinition_amount_rows_on_home__add_.py

示例11: forwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import add_column [as 别名]
def forwards(self, orm):
        # Adding model 'CanonicalFieldEntryLabel'
        db.create_table(u'crowdataapp_canonicalfieldentrylabel', (
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('value', self.gf('django.db.models.fields.CharField')(max_length=50, null=True)),
            ('form_field', self.gf('django.db.models.fields.related.ForeignKey')(related_name='form_field', to=orm['crowdataapp.DocumentSetFormField'])),
        ))
        db.send_create_signal(u'crowdataapp', ['CanonicalFieldEntryLabel'])

        # Adding field 'DocumentSetFieldEntry.canonical_label'
        db.add_column(u'crowdataapp_documentsetfieldentry', 'canonical_label',
                      self.gf('django.db.models.fields.related.ForeignKey')(to=orm['crowdataapp.CanonicalFieldEntryLabel'], null=True),
                      keep_default=False) 
开发者ID:crowdata,项目名称:crowdata,代码行数:15,代码来源:0022_auto__add_canonicalfieldentrylabel__add_field_documentsetfieldentry_ca.py

示例12: forwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import add_column [as 别名]
def forwards(self, orm):
        # Adding field 'DocumentSet.head_html'
        db.add_column(u'crowdataapp_documentset', 'head_html',
                      self.gf('django.db.models.fields.TextField')(default='<!-- <script> or <link rel="stylesheet"> tags go here -->', null=True),
                      keep_default=False) 
开发者ID:crowdata,项目名称:crowdata,代码行数:7,代码来源:0005_auto__add_field_documentset_head_html.py

示例13: forwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import add_column [as 别名]
def forwards(self, orm):
        # Adding field 'DocumentSet.header_image'
        db.add_column(u'crowdataapp_documentset', 'header_image',
                      self.gf('django.db.models.fields.URLField')(max_length=200, null=True, blank=True),
                      keep_default=False) 
开发者ID:crowdata,项目名称:crowdata,代码行数:7,代码来源:0020_auto__add_field_documentset_header_image.py

示例14: forwards

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

        # Adding field 'DocumentSetFormEntry.document'
        db.add_column(u'crowdataapp_documentsetformentry', 'document',
                      self.gf('django.db.models.fields.related.ForeignKey')(default=1, related_name='form_entries', to=orm['crowdataapp.Document']),
                      keep_default=False)

        # Adding field 'DocumentSetFormEntry.user'
        db.add_column(u'crowdataapp_documentsetformentry', 'user',
                      self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True),
                      keep_default=False) 
开发者ID:crowdata,项目名称:crowdata,代码行数:15,代码来源:0003_auto__del_documentuserformentry__add_field_documentsetformentry_docume.py

示例15: forwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import add_column [as 别名]
def forwards(self, orm):
        # Adding field 'DocumentSetFieldEntry.created_at'
        db.add_column(u'crowdataapp_documentsetfieldentry', 'created_at',
                      self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, null=True, blank=True),
                      keep_default=False)

        # Adding field 'DocumentSetFieldEntry.updated_at'
        db.add_column(u'crowdataapp_documentsetfieldentry', 'updated_at',
                      self.gf('django.db.models.fields.DateTimeField')(auto_now=True, null=True, blank=True),
                      keep_default=False) 
开发者ID:crowdata,项目名称:crowdata,代码行数:12,代码来源:0024_auto__add_field_documentsetfieldentry_created_at__add_field_documentse.py


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