• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python db.delete_column函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: forwards

    def forwards(self, orm):
        # Adding model 'Field'
        db.create_table(u'oil_and_gas_field', (
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('name', self.gf('django.db.models.fields.CharField')(default='', unique=True, max_length=50)),
            ('country', self.gf('django.db.models.fields.CharField')(default='', unique=True, max_length=50)),
            ('production_oil', self.gf('django.db.models.fields.TextField')(default='')),
            ('production_gas', self.gf('django.db.models.fields.TextField')(default='')),
            ('production', self.gf('django.db.models.fields.TextField')(default='')),
            ('production_oil_smooth', self.gf('django.db.models.fields.TextField')(default='')),
            ('production_gas_smooth', self.gf('django.db.models.fields.TextField')(default='')),
            ('production_smooth', self.gf('django.db.models.fields.TextField')(default='')),
        ))
        db.send_create_signal(u'oil_and_gas', ['Field'])

        # Deleting field 'CountryProduction.depth'
        db.delete_column(u'oil_and_gas_countryproduction', 'depth')

        # Adding unique constraint on 'CountryProduction', fields ['date', 'name']
        db.create_unique(u'oil_and_gas_countryproduction', ['date', 'name'])

        # Adding unique constraint on 'FieldProduction', fields ['date', 'name']
        db.create_unique(u'oil_and_gas_fieldproduction', ['date', 'name'])

        # Adding unique constraint on 'WellProduction', fields ['date', 'name']
        db.create_unique(u'oil_and_gas_wellproduction', ['date', 'name'])
开发者ID:LucasFievet,项目名称:Tomorrow,代码行数:26,代码来源:0002_auto__add_field__del_field_countryproduction_depth__add_unique_country.py


示例2: backwards

    def backwards(self, orm):
        
        # Deleting field 'Image.textPosition'
        db.delete_column('cmsplugin_s3slider_image', 'textPosition')

        # Deleting field 'Image.text'
        db.delete_column('cmsplugin_s3slider_image', 'text')
开发者ID:Lacrymology,项目名称:cmsplugin_s3slider,代码行数:7,代码来源:0003_auto__add_field_image_textPosition__add_field_image_text.py


示例3: forwards

    def forwards(self, orm):

        # Changing field 'Ingredient.name'
        db.alter_column(u'dishes_ingredient', 'name', self.gf('django.db.models.fields.CharField')(max_length=200))
        # Deleting field 'Dish.new'
        db.delete_column(u'dishes_dish', 'new')

        # Adding field 'Dish.photo'
        db.add_column(u'dishes_dish', 'photo',
                      self.gf('django.db.models.fields.files.FileField')(max_length=100, null=True),
                      keep_default=False)

        # Adding field 'Dish.likes'
        db.add_column(u'dishes_dish', 'likes',
                      self.gf('django.db.models.fields.IntegerField')(default=0),
                      keep_default=False)


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

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

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

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


示例4: backwards

    def backwards(self, orm):
        # Deleting field 'Product.price'
        db.delete_column(u'products_product', 'price_id')

        # Deleting field 'Product.employee_price'
        db.delete_column(u'products_product', 'employee_price_id')


        # Changing field 'Sale.size'
        db.alter_column(u'products_sale', 'size_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['products.Size']))

        # Changing field 'Sale.color'
        db.alter_column(u'products_sale', 'color_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['products.Color']))

        # Changing field 'Sale.price'
        db.alter_column(u'products_sale', 'price_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['products.Price']))

        # Changing field 'Sale.sex'
        db.alter_column(u'products_sale', 'sex_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['products.Sex']))

        # Changing field 'Delivery.color'
        db.alter_column(u'products_delivery', 'color_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['products.Color']))

        # Changing field 'Delivery.sex'
        db.alter_column(u'products_delivery', 'sex_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['products.Sex']))

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


示例5: forwards

    def forwards(self, orm):

        # Changing field 'Customer.user'
        db.alter_column(u'core_customer', 'user_id', self.gf('ppars.apps.core.fields.BigForeignKey')(to=orm['auth.User'], null=True, on_delete=models.SET_NULL))

        # Changing field 'PlanDiscount.user'
        db.alter_column(u'core_plandiscount', 'user_id', self.gf('ppars.apps.core.fields.BigForeignKey')(to=orm['auth.User'], null=True, on_delete=models.SET_NULL))

        # Changing field 'Transaction.user'
        db.alter_column(u'core_transaction', 'user_id', self.gf('ppars.apps.core.fields.BigForeignKey')(to=orm['auth.User'], null=True, on_delete=models.SET_NULL))

        # Changing field 'Log.user'
        db.alter_column(u'core_log', 'user_id', self.gf('ppars.apps.core.fields.BigForeignKey')(to=orm['auth.User'], null=True, on_delete=models.SET_NULL))

        # Changing field 'UnusedPin.user'
        db.alter_column(u'core_unusedpin', 'user_id', self.gf('ppars.apps.core.fields.BigForeignKey')(to=orm['auth.User'], null=True, on_delete=models.SET_NULL))
        # Deleting field 'CarrierAdmin.user'
        db.delete_column(u'core_carrieradmin', 'user_id')


        # Changing field 'CaptchaLogs.user'
        db.alter_column(u'core_captchalogs', 'user_id', self.gf('ppars.apps.core.fields.BigForeignKey')(to=orm['auth.User'], null=True, on_delete=models.SET_NULL))

        # Changing field 'AutoRefill.user'
        db.alter_column(u'core_autorefill', 'user_id', self.gf('ppars.apps.core.fields.BigForeignKey')(to=orm['auth.User'], null=True, on_delete=models.SET_NULL))
开发者ID:adulenzy,项目名称:Auto-phone-recharge-system,代码行数:25,代码来源:0037_auto__chg_field_customer_user__chg_field_plandiscount_user__chg_field_.py


示例6: 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


示例7: backwards

    def backwards(self, orm):
        
        # Deleting field 'ScheduledTask.last_execution'
        db.delete_column('scheduler_scheduledtask', 'last_execution')

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


示例8: forwards

    def forwards(self, orm):
        # Adding model 'DynamicPage'
        db.create_table(u'main_dynamicpage', (
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('slug', self.gf('django.db.models.fields.SlugField')(max_length=50)),
            ('template', self.gf('django.db.models.fields.CharField')(max_length=256)),
            ('content_hebrew', self.gf('django.db.models.fields.TextField')()),
            ('content_english', self.gf('django.db.models.fields.TextField')()),
        ))
        db.send_create_signal(u'main', ['DynamicPage'])

        # Deleting field 'NavbarLink.url'
        db.delete_column(u'main_navbarlink', 'url')

        # Adding field 'NavbarLink.link_type'
        db.add_column(u'main_navbarlink', 'link_type',
                      self.gf('django.db.models.fields.CharField')(default='category', max_length=256),
                      keep_default=False)

        # Adding field 'NavbarLink.category'
        db.add_column(u'main_navbarlink', 'category',
                      self.gf('django.db.models.fields.related.ForeignKey')(to=orm['main.Category'], null=True, blank=True),
                      keep_default=False)

        # Adding field 'NavbarLink.page'
        db.add_column(u'main_navbarlink', 'page',
                      self.gf('django.db.models.fields.related.ForeignKey')(to=orm['main.DynamicPage'], null=True, blank=True),
                      keep_default=False)
开发者ID:hochbergg,项目名称:petulant-avenger,代码行数:28,代码来源:0013_auto__add_dynamicpage__del_field_navbarlink_url__add_field_navbarlink_.py


示例9: backwards

    def backwards(self, orm):
        # Deleting field 'StudentTeam.member5'
        db.delete_column('hedgefunds_studentteam', 'member5_id')


        # User chose to not deal with backwards NULL issues for 'StudentTeam.member4'
        raise RuntimeError("Cannot reverse this migration. 'StudentTeam.member4' and its values cannot be restored.")
开发者ID:aaksham,项目名称:HFMG2012V1,代码行数:7,代码来源:0002_auto__add_field_studentteam_member5__chg_field_studentteam_member4.py


示例10: forwards

 def forwards(self, orm):
     
     # Deleting field 'File.public'
     db.delete_column('cmsplugin_file', 'public_id')
     
     # Deleting model 'filepublic'
     db.delete_table('cmsplugin_filepublic')
开发者ID:Krystal,项目名称:django-cms-2.0,代码行数:7,代码来源:0005_publisher2.py


示例11: forwards

    def forwards(self, orm):
        
        # Deleting field 'Project.private'
        db.delete_column('gitlog_project', 'private')

        # Deleting field 'Project.source'
        db.delete_column('gitlog_project', 'source')

        # Adding field 'Project.public'
        db.add_column('gitlog_project', 'public', self.gf('django.db.models.fields.BooleanField')(default=False), keep_default=False)

        # Adding field 'Project.url'
        db.add_column('gitlog_project', 'url', self.gf('django.db.models.fields.URLField')(max_length=30, null=True, blank=True), keep_default=False)

        # Adding field 'Project.description'
        db.add_column('gitlog_project', 'description', self.gf('django.db.models.fields.TextField')(null=True, blank=True), keep_default=False)

        # Adding M2M table for field writable on 'Project'
        db.create_table('gitlog_project_writable', (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('project', models.ForeignKey(orm['gitlog.project'], null=False)),
            ('user', models.ForeignKey(orm['auth.user'], null=False))
        ))
        db.create_unique('gitlog_project_writable', ['project_id', 'user_id'])

        # Adding M2M table for field readonly on 'Project'
        db.create_table('gitlog_project_readonly', (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('project', models.ForeignKey(orm['gitlog.project'], null=False)),
            ('user', models.ForeignKey(orm['auth.user'], null=False))
        ))
        db.create_unique('gitlog_project_readonly', ['project_id', 'user_id'])

        # Changing field 'Project.owner'
        db.alter_column('gitlog_project', 'owner_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, to=orm['auth.User']))
开发者ID:masarliev,项目名称:gitlog,代码行数:35,代码来源:0002_auto__del_field_project_private__del_field_project_source__add_field_p.py


示例12: backwards

 def backwards(self, orm):
     
     # Deleting field 'RoundupBugTracker.name'
     db.delete_column('customs_roundupbugtracker', 'name')
     
     # Deleting field 'RoundupBugTracker.components'
     db.delete_column('customs_roundupbugtracker', 'components')
开发者ID:1234-,项目名称:oh-mainline,代码行数:7,代码来源:0007_roundupbugtracker_name_and_components.py


示例13: 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


示例14: 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


示例15: forwards

    def forwards(self, orm):
        
        # Deleting field 'LegAction.minutes'
        db.delete_column('phillyleg_legaction', 'minutes_id')

        # Adding unique constraint on 'LegMinutes', fields ['id']
        db.create_unique('phillyleg_legminutes', ['id'])
开发者ID:Alexander-M-Waldman,项目名称:councilmatic,代码行数:7,代码来源:0011_auto__del_field_legaction_minutes__add_field_legaction_minutes_tmpid__.py


示例16: backwards

    def backwards(self, orm):
        
        # Deleting field 'ExampleModel.fk_field'
        db.delete_column('xml_examplemodel', 'fk_field_id')

        # Removing M2M table for field mm_field on 'ExampleModel'
        db.delete_table('xml_examplemodel_mm_field')
开发者ID:heigler,项目名称:django_odin,代码行数:7,代码来源:0002_add_fkmm_fields.py


示例17: backwards

    def backwards(self, orm):

        # Deleting field 'Group.time_spent_total'
        db.delete_column('sentry_groupedmessage', 'time_spent_total')

        # Deleting field 'Group.time_spent_count'
        db.delete_column('sentry_groupedmessage', 'time_spent_count')
开发者ID:280185386,项目名称:sentry,代码行数:7,代码来源:0024_auto__add_field_group_time_spent_total__add_field_group_time_spent_cou.py


示例18: 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


示例19: forwards

    def forwards(self, orm):

        # Deleting field 'Account.update_leads_on_unformed_events'
        db.delete_column("webinars_account", "update_leads_on_unformed_events")

        # Deleting field 'Account.email'
        db.delete_column("webinars_account", "email")

        # Adding field 'Account.prevent_unformed_lead_import'
        db.add_column(
            "webinars_account",
            "prevent_unformed_lead_import",
            self.gf("django.db.models.fields.BooleanField")(default=False),
            keep_default=False,
        )

        # Adding field 'Event.mothballed'
        db.add_column(
            "webinars_event",
            "mothballed",
            self.gf("django.db.models.fields.BooleanField")(default=False),
            keep_default=False,
        )

        # Adding field 'Event.unknowable_registrants'
        db.add_column(
            "webinars_event",
            "unknowable_registrants",
            self.gf("django.db.models.fields.BooleanField")(default=False),
            keep_default=False,
        )
开发者ID:prior,项目名称:webinars,代码行数:31,代码来源:0009_random_changes.py


示例20: forwards

    def forwards(self, orm):
        # Adding model 'Achievement'
        db.create_table('attestation_achievement', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('name', self.gf('django.db.models.fields.CharField')(max_length=128)),
        ))
        db.send_create_signal('attestation', ['Achievement'])

        # Deleting field 'Request.degree'
        db.delete_column('attestation_request', 'degree_id')

        # Adding M2M table for field degrees on 'Request'
        db.create_table('attestation_request_degrees', (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('request', models.ForeignKey(orm['attestation.request'], null=False)),
            ('degree', models.ForeignKey(orm['attestation.degree'], null=False))
        ))
        db.create_unique('attestation_request_degrees', ['request_id', 'degree_id'])

        # Adding M2M table for field achievements on 'Request'
        db.create_table('attestation_request_achievements', (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('request', models.ForeignKey(orm['attestation.request'], null=False)),
            ('achievement', models.ForeignKey(orm['attestation.achievement'], null=False))
        ))
        db.create_unique('attestation_request_achievements', ['request_id', 'achievement_id'])
开发者ID:ClearMind,项目名称:doin,代码行数:26,代码来源:0027_auto__add_achievement__del_field_request_degree.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python db.delete_foreign_key函数代码示例发布时间:2022-05-27
下一篇:
Python db.create_unique函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap