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