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


Python db.add_column函数代码示例

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


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

示例1: forwards

    def forwards(self, orm):
        
        # Adding field 'Project.programme'
        db.add_column('projects_project', 'programme', self.gf('django.db.models.fields.related.ForeignKey')(default=1, to=orm['programmes.Programme']), keep_default=False)

        # Removing M2M table for field programme on 'Project'
        db.delete_table('projects_project_programme')
开发者ID:andy071001,项目名称:efo-on-django-cms,代码行数:7,代码来源:0002_auto__add_field_project_programme.py

示例2: forwards

    def forwards(self, orm):
        
        # Adding field 'Image.textPosition'
        db.add_column('cmsplugin_s3slider_image', 'textPosition', self.gf('django.db.models.fields.CharField')(default='bottom', max_length=6), keep_default=False)

        # Adding field 'Image.text'
        db.add_column('cmsplugin_s3slider_image', 'text', self.gf('django.db.models.fields.CharField')(default='', max_length=2047, blank=True), keep_default=False)
开发者ID:Lacrymology,项目名称:cmsplugin_s3slider,代码行数:7,代码来源:0003_auto__add_field_image_textPosition__add_field_image_text.py

示例3: forwards

    def forwards(self, orm):

        # Adding field 'Group.time_spent_total'
        db.add_column('sentry_groupedmessage', 'time_spent_total', self.gf('django.db.models.fields.FloatField')(default=0), keep_default=False)

        # Adding field 'Group.time_spent_count'
        db.add_column('sentry_groupedmessage', 'time_spent_count', self.gf('django.db.models.fields.IntegerField')(default=0), keep_default=False)
开发者ID:280185386,项目名称:sentry,代码行数:7,代码来源:0024_auto__add_field_group_time_spent_total__add_field_group_time_spent_cou.py

示例4: backwards

 def backwards(self, orm):
     
     # Deleting field 'BugzillaUrl.tracker'
     db.delete_column('customs_bugzillaurl', 'tracker_id')
     
     # Adding field 'BugzillaUrl.bugzilla_tracker'
     db.add_column('customs_bugzillaurl', 'bugzilla_tracker', orm['customs.bugzillaurl:bugzilla_tracker'])
开发者ID:jledbetter,项目名称:openhatch,代码行数:7,代码来源:0013_fix_fieldname_in_bugzillaurl.py

示例5: forwards

    def forwards(self, orm):
        
        # Adding field 'Link.created_on'
        db.add_column('projects_link', 'created_on', self.gf('django.db.models.fields.DateTimeField')(default=datetime.date(2010, 11, 29), auto_now_add=True, blank=True), keep_default=False)

        # Adding field 'Project.created_on'
        db.add_column('projects_project', 'created_on', self.gf('django.db.models.fields.DateTimeField')(default=datetime.date(2010, 11, 29), auto_now_add=True, blank=True), keep_default=False)
开发者ID:Acidburn0zzz,项目名称:lernanta,代码行数:7,代码来源:0003_auto__add_field_link_created_on__add_field_project_created_on.py

示例6: forwards

    def forwards(self, orm):
        
        # Adding field 'Plan.spreedly_site_name'
        db.add_column('spreedly_plan', 'spreedly_site_name', self.gf('django.db.models.fields.CharField')(max_length=255, null=True), keep_default=False)

        # Adding field 'Subscription.spreedly_site_name'
        db.add_column('spreedly_subscription', 'spreedly_site_name', self.gf('django.db.models.fields.CharField')(max_length=255, null=True), keep_default=False)
开发者ID:guitarparty,项目名称:django-spreedly,代码行数:7,代码来源:0003_auto__add_field_plan_spreedly_site_name__add_field_subscription_spreed.py

示例7: backwards

    def backwards(self, orm):

        # Changing field 'Ingredient.name'
        db.alter_column(u'dishes_ingredient', 'name', self.gf('django.db.models.fields.CharField')(max_length=30))
        # Adding field 'Dish.new'
        db.add_column(u'dishes_dish', 'new',
                      self.gf('django.db.models.fields.BooleanField')(default=False),
                      keep_default=False)

        # Deleting field 'Dish.photo'
        db.delete_column(u'dishes_dish', 'photo')

        # Deleting field 'Dish.likes'
        db.delete_column(u'dishes_dish', 'likes')


        # Changing field 'Dish.flavors'
        db.alter_column(u'dishes_dish', 'flavors', self.gf('django.db.models.fields.CharField')(max_length=50))

        # Changing field 'Dish.cuisine'
        db.alter_column(u'dishes_dish', 'cuisine', self.gf('django.db.models.fields.CharField')(max_length=30))

        # Changing field 'Dish.name'
        db.alter_column(u'dishes_dish', 'name', self.gf('django.db.models.fields.CharField')(max_length=30))

        # Changing field 'Dish.prep_time'
        db.alter_column(u'dishes_dish', 'prep_time', self.gf('django.db.models.fields.FloatField')())
开发者ID:AzizHarrington,项目名称:recipebook,代码行数:27,代码来源:0002_auto__chg_field_ingredient_name__del_field_dish_new__add_field_dish_ph.py

示例8: forwards

    def forwards(self, orm):
        
        # Deleting field 'StorageItem.date'
        db.delete_column('recipemonkeyapp_storageitem', 'date')

        # Adding field 'StorageItem.date_added'
        db.add_column('recipemonkeyapp_storageitem', 'date_added', self.gf('django.db.models.fields.DateField')(auto_now_add=True, null=True, blank=True), keep_default=False)
开发者ID:vanessacochrane,项目名称:Recipe-Monkey,代码行数:7,代码来源:0005_auto__del_field_storageitem_date__add_field_storageitem_date_added.py

示例9: forwards

    def forwards(self, orm):
        # Adding field 'Product.price'
        db.add_column(u'products_product', 'price',
                      self.gf('django.db.models.fields.related.ForeignKey')(default=1, to=orm['products.Price']),
                      keep_default=False)

        # Adding field 'Product.employee_price'
        db.add_column(u'products_product', 'employee_price',
                      self.gf('django.db.models.fields.related.ForeignKey')(default=1, related_name='employee_products', to=orm['products.Price']),
                      keep_default=False)


        # Changing field 'Sale.size'
        db.alter_column(u'products_sale', 'size_id', self.gf('smart_selects.db_fields.ChainedForeignKey')(to=orm['products.Size']))

        # Changing field 'Sale.color'
        db.alter_column(u'products_sale', 'color_id', self.gf('smart_selects.db_fields.ChainedForeignKey')(to=orm['products.Color']))

        # Changing field 'Sale.price'
        db.alter_column(u'products_sale', 'price_id', self.gf('smart_selects.db_fields.ChainedForeignKey')(to=orm['products.Price']))

        # Changing field 'Sale.sex'
        db.alter_column(u'products_sale', 'sex_id', self.gf('smart_selects.db_fields.ChainedForeignKey')(to=orm['products.Sex']))

        # Changing field 'Delivery.color'
        db.alter_column(u'products_delivery', 'color_id', self.gf('smart_selects.db_fields.ChainedForeignKey')(to=orm['products.Color']))

        # Changing field 'Delivery.sex'
        db.alter_column(u'products_delivery', 'sex_id', self.gf('smart_selects.db_fields.ChainedForeignKey')(to=orm['products.Sex']))

        # Changing field 'Delivery.size'
        db.alter_column(u'products_delivery', 'size_id', self.gf('smart_selects.db_fields.ChainedForeignKey')(to=orm['products.Size']))
开发者ID:kakulukia,项目名称:merch36,代码行数:32,代码来源:0005_auto__add_field_product_price__add_field_product_employee_price__chg_f.py

示例10: forwards

    def forwards(self, orm):
        
        # Adding field 'CommitmentMember.social_email2'
        db.add_column('activities_commitmentmember', 'social_email2', self.gf('django.db.models.fields.TextField')(null=True, blank=True), keep_default=False)

        # Adding field 'ActivityMember.social_email2'
        db.add_column('activities_activitymember', 'social_email2', self.gf('django.db.models.fields.TextField')(null=True, blank=True), keep_default=False)
开发者ID:keokilee,项目名称:makahiki,代码行数:7,代码来源:0023_auto__add_field_commitmentmember_social_email2__add_field_activitymemb.py

示例11: backwards

    def backwards(self, orm):
        # Deleting field 'SpokeAboutUs.spoke_source_uid'
        db.delete_column(u'spokeaboutus_spokeaboutus', 'spoke_source_uid')


        # User chose to not deal with backwards NULL issues for 'SpokeSource.name'
        raise RuntimeError("Cannot reverse this migration. 'SpokeSource.name' and its values cannot be restored.")
        # Adding field 'SpokeSource.icon'
        db.add_column(u'spokeaboutus_spokesource', 'icon',
                      self.gf('django.db.models.fields.files.ImageField')(max_length=100, null=True, blank=True),
                      keep_default=False)

        # Deleting field 'SpokeSource.spoke_source'
        db.delete_column(u'spokeaboutus_spokesource', 'spoke_source')

        # Deleting field 'SpokeSource.limit'
        db.delete_column(u'spokeaboutus_spokesource', 'limit')

        # Deleting field 'SpokeSource.search_query'
        db.delete_column(u'spokeaboutus_spokesource', 'search_query')

        # Deleting field 'SpokeSource.periodicity'
        db.delete_column(u'spokeaboutus_spokesource', 'periodicity')

        # Deleting field 'SpokeSource.updated'
        db.delete_column(u'spokeaboutus_spokesource', 'updated')
开发者ID:tomaszroszko,项目名称:django-spokeaboutus,代码行数:26,代码来源:0003_auto__add_field_spokeaboutus_spoke_source_uid__del_field_spokesource_n.py

示例12: forwards

    def forwards(self, orm):
        
        # Adding field 'ScheduledTask.last_execution'
        db.add_column('scheduler_scheduledtask', 'last_execution', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True), keep_default=False)

        # Changing field 'ScheduledTask.next_execution'
        db.alter_column('scheduler_scheduledtask', 'next_execution', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True))
开发者ID:Betriebsrat,项目名称:ecm,代码行数:7,代码来源:0002_auto__add_field_scheduledtask_last_execution__chg_field_scheduledtask_.py

示例13: forwards

    def forwards(self, orm):
        
        # Adding field 'Document.replaces'
        db.add_column('indivo_document', 'replaces', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['indivo.Document'], null=True), keep_default=False)

        # Adding field 'Document.processed'
        db.add_column('indivo_document', 'processed', self.gf('django.db.models.fields.BooleanField')(default=False), keep_default=False)
开发者ID:Dhanayan123,项目名称:indivo_server,代码行数:7,代码来源:0004_move_doc_processing_to_model.py

示例14: forwards

    def forwards(self, orm):

        if was_applied(__file__, 'old_app'):
            return
        
        # Adding field 'Something.new_value'
        db.add_column('old_app_something', 'new_value', self.gf('django.db.models.fields.IntegerField')(default=0), keep_default=False)
开发者ID:ASKBOT,项目名称:django-south-app-rename-example,代码行数:7,代码来源:0002_auto__add_field_something_new_value.py

示例15: backwards

    def backwards(self, orm):
        # Adding model 'Customer'
        db.create_table(u'attendees_customer', (
            ('conference', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['conference.Conference'], null=True, on_delete=models.PROTECT)),
            ('is_exported', self.gf('django.db.models.fields.BooleanField')(default=False)),
            ('email', self.gf('django.db.models.fields.EmailField')(max_length=250)),
            ('date_added', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime.now)),
            ('customer_number', self.gf('django.db.models.fields.IntegerField')(blank=True)),
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
        ))
        db.send_create_signal(u'attendees', ['Customer'])

        # Adding unique constraint on 'Customer', fields ['customer_number', 'conference']
        db.create_unique(u'attendees_customer', ['customer_number', 'conference_id'])


        # User chose to not deal with backwards NULL issues for 'Purchase.customer'
        raise RuntimeError("Cannot reverse this migration. 'Purchase.customer' and its values cannot be restored.")
        
        # The following code is provided here to aid in writing a correct migration        # Adding field 'Purchase.customer'
        db.add_column(u'attendees_purchase', 'customer',
                      self.gf('django.db.models.fields.related.ForeignKey')(to=orm['attendees.Customer']),
                      keep_default=False)

        # Deleting field 'Purchase.email'
        db.delete_column(u'attendees_purchase', 'email')
开发者ID:DanielSzoska,项目名称:djep,代码行数:26,代码来源:0012_auto__del_customer__del_unique_customer_customer_number_conference__de.py


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