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

Python db.alter_column函数代码示例

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

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



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

示例1: forwards

    def forwards(self, orm):
        
        # Changing field 'UserProfile.timezone'
        db.alter_column('main_userprofile', 'timezone', self.gf('timezones.fields.TimeZoneField')())

        # Adding field 'UserService.public'
        db.add_column('main_userservice', 'public', self.gf('django.db.models.fields.NullBooleanField')(default=False, null=True, blank=True), keep_default=False)
开发者ID:1stvamp,项目名称:causal,代码行数:7,代码来源:0006_auto__chg_field_userprofile_timezone__add_field_userservice_public.py


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


示例3: forwards

    def forwards(self, orm):
        # Adding model 'CalendarGroup'
        db.create_table('schedule_calendargroup', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('name', self.gf('django.db.models.fields.CharField')(max_length=40)),
            ('color', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['main.Color'])),
        ))
        db.send_create_signal('schedule', ['CalendarGroup'])

        # Adding M2M table for field members on 'CalendarGroup'
        db.create_table('schedule_calendargroup_members', (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('calendargroup', models.ForeignKey(orm['schedule.calendargroup'], null=False)),
            ('user', models.ForeignKey(orm['auth.user'], null=False))
        ))
        db.create_unique('schedule_calendargroup_members', ['calendargroup_id', 'user_id'])

        # Adding field 'Event.group'
        db.add_column('schedule_event', 'group',
                      self.gf('django.db.models.fields.related.ForeignKey')(to=orm['schedule.CalendarGroup'], null=True, blank=True),
                      keep_default=False)


        # Changing field 'Event.calendar'
        db.alter_column('schedule_event', 'calendar_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['schedule.Calendar'], null=True))
开发者ID:ejaury,项目名称:maitreya_van,代码行数:25,代码来源:0003_add_calendar_group.py


示例4: forwards

    def forwards(self, orm):
        
        # Removing unique constraint on 'Task', fields ['model_solution']
        db.delete_unique('tasks_task', ['model_solution_id'])

        # Changing field 'Task.model_solution'
        db.alter_column('tasks_task', 'model_solution_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, to=orm['solutions.Solution']))
开发者ID:juliushaertl,项目名称:Praktomat,代码行数:7,代码来源:0005_auto__chg_field_task_model_solution__del_unique_task_model_solution.py


示例5: forwards

 def forwards(self, orm):
     
     # Deleting field 'SavedSearch.openid_user'
     db.delete_column('localtv_savedsearch', 'openid_user_id')
     
     # Deleting field 'OpenIdUser.status'
     db.delete_column('localtv_openiduser', 'status')
     
     # Deleting field 'Watch.openid_user'
     db.delete_column('localtv_watch', 'openid_user_id')
     
     # Deleting field 'OpenIdUser.superuser'
     db.delete_column('localtv_openiduser', 'superuser')
     
     # Deleting field 'OpenIdUser.nickname'
     db.delete_column('localtv_openiduser', 'nickname')
     
     # Deleting field 'OpenIdUser.email'
     db.delete_column('localtv_openiduser', 'email')
     
     # Deleting field 'Feed.openid_user'
     db.delete_column('localtv_feed', 'openid_user_id')
     
     # Deleting field 'Video.openid_user'
     db.delete_column('localtv_video', 'openid_user_id')
     
     # Dropping ManyToManyField 'SiteLocation.admins'
     db.delete_table('localtv_sitelocation_admins')
     
     # Changing field 'OpenIdUser.user'
     # (to signature: django.db.models.fields.related.OneToOneField(to=orm['auth.User'], unique=True))
     db.alter_column('localtv_openiduser', 'user_id', orm['localtv.openiduser:user'])
开发者ID:natea,项目名称:Miro-Community,代码行数:32,代码来源:0004_remove_openid_fields.py


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


示例7: forwards

    def forwards(self, orm):

        # Changing field 'Feedback.browser'
        db.alter_column(u'feedback_feedback', 'browser', self.gf('django.db.models.fields.CharField')(max_length=250, null=True))

        # Changing field 'AnonymousFeedback.browser'
        db.alter_column(u'feedback_anonymousfeedback', 'browser', self.gf('django.db.models.fields.CharField')(max_length=250, null=True))
开发者ID:laucia,项目名称:django-ajax-feedback,代码行数:7,代码来源:0004_auto__chg_field_feedback_browser__chg_field_anonymousfeedback_browser.py


示例8: forwards

    def forwards(self, orm):
        
        # Changing field 'Keyword.title'
        db.alter_column('generic_keyword', 'title', self.gf('django.db.models.fields.CharField')(max_length=500))

        # Changing field 'Keyword.slug'
        db.alter_column('generic_keyword', 'slug', self.gf('django.db.models.fields.CharField')(max_length=2000, null=True))
开发者ID:aTnT,项目名称:mezzanine-dotcloud,代码行数:7,代码来源:0009_auto__chg_field_keyword_title__chg_field_keyword_slug.py


示例9: forwards

    def forwards(self, orm):

        # Changing field 'RentPost.total_rooms'
        db.alter_column(u'posts_rentpost', 'total_rooms', self.gf('django.db.models.fields.PositiveSmallIntegerField')(null=True))

        # Changing field 'RentPost.total_baths'
        db.alter_column(u'posts_rentpost', 'total_baths', self.gf('django.db.models.fields.PositiveSmallIntegerField')(null=True))
开发者ID:Guannan2014,项目名称:ClassifiedAdvertisement,代码行数:7,代码来源:0002_auto__chg_field_rentpost_total_rooms__chg_field_rentpost_total_baths.py


示例10: forwards

    def forwards(self, orm):

        # Changing field 'Message.date'
        db.alter_column('questions_message', 'date', self.gf('django.db.models.fields.DateTimeField')())

        # Changing field 'MessageView.date'
        db.alter_column('questions_messageview', 'date', self.gf('django.db.models.fields.DateTimeField')())
开发者ID:matrach,项目名称:oioioi,代码行数:7,代码来源:0004_auto__chg_field_message_date__chg_field_messageview_date.py


示例11: forwards

 def forwards(self, orm):
     db.rename_table('speeches_popolospeaker', 'speeches_speaker')
     db.alter_column('speeches_recordingtimestamp', 'speaker_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['speeches.Speaker'], null=True, on_delete=models.SET_NULL))
     db.alter_column('speeches_speech', 'speaker_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['speeches.Speaker'], null=True, on_delete=models.SET_NULL))
     if not db.dry_run:
         orm['contenttypes.contenttype'].objects.filter(app_label='speeches', model='speaker').update(model='oldspeaker')
         orm['contenttypes.contenttype'].objects.filter(app_label='speeches', model='popolospeaker').update(model='speaker')
开发者ID:dracos,项目名称:sayit,代码行数:7,代码来源:0054__rename_popolospeaker.py


示例12: backwards

    def backwards(self, orm):
        # Adding field 'Course.end_time'
        db.add_column(u'courses_course', 'end_time',
                      self.gf('django.db.models.fields.DateField')(default=datetime.datetime(2014, 4, 19, 0, 0)),
                      keep_default=False)

        # Adding field 'Course.start_time'
        db.add_column(u'courses_course', 'start_time',
                      self.gf('django.db.models.fields.DateField')(default=datetime.datetime(2014, 4, 19, 0, 0)),
                      keep_default=False)

        # Adding field 'Course.enable_applications'
        db.add_column(u'courses_course', 'enable_applications',
                      self.gf('django.db.models.fields.BooleanField')(default=False),
                      keep_default=False)

        # Deleting field 'Course.application_until'
        db.delete_column(u'courses_course', 'application_until')

        # Deleting field 'Course.next_season_mail_list'
        db.delete_column(u'courses_course', 'next_season_mail_list')


        # Changing field 'Course.description'
        db.alter_column(u'courses_course', 'description', self.gf('django.db.models.fields.TextField')())
开发者ID:sebastian-code,项目名称:Odin,代码行数:25,代码来源:0010_auto__del_field_course_end_time__del_field_course_start_time__del_fiel.py


示例13: backwards

    def backwards(self, orm):

        # Changing field 'Organization.name'
        db.alter_column('organizations_organization', 'name', self.gf('django.db.models.fields.CharField')(max_length=50))

        # Changing field 'Organization.slug'
        db.alter_column('organizations_organization', 'slug', self.gf('django.db.models.fields.SlugField')(max_length=50, unique=True))
开发者ID:CARocha,项目名称:django-organizations,代码行数:7,代码来源:0002_auto__chg_field_organization_name__chg_field_organization_slug.py


示例14: forwards

    def forwards(self, orm):

        # Changing field 'Album.head'
        db.alter_column(u'imagestore_album', 'head_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, on_delete=models.SET_NULL, to=orm['imagestore.Image']))

        # Changing field 'Album.user'
        db.alter_column(u'imagestore_album', 'user_id', self.gf('django.db.models.fields.related.ForeignKey')(default=0, to=orm['auth.User']))
开发者ID:rusbal,项目名称:imagestore,代码行数:7,代码来源:0015_auto__chg_field_album_head__chg_field_album_user.py


示例15: forwards

    def forwards(self, orm):
        
        # Changing field 'ExtensionVersion.source'
        db.alter_column('extensions_extensionversion', 'source', self.gf('django.db.models.fields.files.FileField')(max_length=223))

        # Changing field 'ExtensionVersion.version'
        db.alter_column('extensions_extensionversion', 'version', self.gf('django.db.models.fields.IntegerField')())
开发者ID:fungusakafungus,项目名称:sweettooth,代码行数:7,代码来源:0007_auto__chg_field_extensionversion_source__chg_field_extensionversion_ve.py


示例16: forwards

    def forwards(self, orm):

        # Changing field 'Organization.email'
        db.alter_column('exmo2010_organization', 'email', self.gf('exmo2010.models.EmailsField')(null=True))

        # Changing field 'Organization.phone'
        db.alter_column('exmo2010_organization', 'phone', self.gf('exmo2010.models.PhonesField')(null=True))
开发者ID:bsavelev,项目名称:exmo2010,代码行数:7,代码来源:0008_auto__chg_field_organization_email__chg_field_organization_phone.py


示例17: backwards

    def backwards(self, orm):
        # Removing index on 'UserProfile', fields ['slug']
        db.delete_index(u'spa_userprofile', ['slug'])


        # Changing field 'UserProfile.slug'
        db.alter_column(u'spa_userprofile', 'slug', self.gf('django.db.models.fields.CharField')(max_length=35, null=True))
开发者ID:fergalmoran,项目名称:dss,代码行数:7,代码来源:0005_auto__chg_field_userprofile_slug.py


示例18: backwards

    def backwards(self, orm):

        # Changing field 'Organization.email'
        db.alter_column('exmo2010_organization', 'email', self.gf('django.db.models.fields.TextField')(null=True))

        # Changing field 'Organization.phone'
        db.alter_column('exmo2010_organization', 'phone', self.gf('django.db.models.fields.TextField')(null=True))
开发者ID:bsavelev,项目名称:exmo2010,代码行数:7,代码来源:0008_auto__chg_field_organization_email__chg_field_organization_phone.py


示例19: backwards

    def backwards(self, orm):
        # Removing M2M table for field supervisors on 'SupportGroup'
        db.delete_table('live_support_supportgroup_supervisors')


        # Changing field 'Chat.hash_key'
        db.alter_column('live_support_chat', 'hash_key', self.gf('django.db.models.fields.CharField')(default='', max_length=64, unique=True))
开发者ID:MegaMark16,项目名称:django-live-support,代码行数:7,代码来源:0003_auto__chg_field_chat_hash_key.py


示例20: backwards

    def backwards(self, orm):
        # Adding M2M table for field comment on 'Event'
        m2m_table_name = db.shorten_name(u'event_event_comment')
        db.create_table(m2m_table_name, (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('event', models.ForeignKey(orm[u'event.event'], null=False)),
            ('comment', models.ForeignKey(orm[u'comment.comment'], null=False))
        ))
        db.create_unique(m2m_table_name, ['event_id', 'comment_id'])


        # Changing field 'Event.category'
        db.alter_column(u'event_event', 'category_id', self.gf('django.db.models.fields.related.ForeignKey')(default=1, to=orm['event.EventCategory']))

        # Changing field 'Event.fr'
        db.alter_column(u'event_event', 'fr', self.gf('django.db.models.fields.DateTimeField')(default=1))

        # Changing field 'Event.cover'
        db.alter_column(u'event_event', 'cover', self.gf('django.db.models.fields.files.ImageField')(default=1, max_length=100))

        # Changing field 'Event.to'
        db.alter_column(u'event_event', 'to', self.gf('django.db.models.fields.DateTimeField')(default=1))

        # Changing field 'Event.place'
        db.alter_column(u'event_event', 'place', self.gf('django.db.models.fields.CharField')(default=1, max_length=250))
开发者ID:neudesk,项目名称:20thst,代码行数:25,代码来源:0015_auto__chg_field_event_category__chg_field_event_fr__chg_field_event_co.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python db.commit_transaction函数代码示例发布时间:2022-05-27
下一篇:
Python db.add_column函数代码示例发布时间: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