本文整理汇总了Python中south.db.db.create_index方法的典型用法代码示例。如果您正苦于以下问题:Python db.create_index方法的具体用法?Python db.create_index怎么用?Python db.create_index使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类south.db.db
的用法示例。
在下文中一共展示了db.create_index方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: forwards
# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import create_index [as 别名]
def forwards(self, orm):
# Renaming column for 'Comment.parent_content' to match new field type.
db.rename_column('canvas_comment', 'parent_content', 'parent_content_id')
# Changing field 'Comment.parent_content'
db.alter_column('canvas_comment', 'parent_content_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['canvas.Content']))
# Adding index on 'Comment', fields ['parent_content']
db.create_index('canvas_comment', ['parent_content_id'])
# Renaming column for 'Comment.reply_content' to match new field type.
db.rename_column('canvas_comment', 'reply_content', 'reply_content_id')
# Changing field 'Comment.reply_content'
db.alter_column('canvas_comment', 'reply_content_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, to=orm['canvas.Content']))
# Adding index on 'Comment', fields ['reply_content']
db.create_index('canvas_comment', ['reply_content_id'])
开发者ID:canvasnetworks,项目名称:canvas,代码行数:19,代码来源:0021_auto__chg_field_comment_parent_content__chg_field_comment_reply_conten.py
示例2: forwards
# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import create_index [as 别名]
def forwards(self, orm):
# Adding field 'Instance.is_deleted'
db.add_column('odk_logger_instance', 'is_deleted',
self.gf('django.db.models.fields.BooleanField')(default=False),
keep_default=True)
# Adding index on 'Instance', fields ['xform']
db.create_index('odk_logger_instance', ['xform_id', 'is_deleted'])
示例3: forwards
# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import create_index [as 别名]
def forwards(self, orm):
# Adding index on 'Tweet', fields ['analyzed_by']
db.create_index(u'twitter_stream_tweet', ['analyzed_by'])
# Adding index on 'Tweet', fields ['created_at']
db.create_index(u'twitter_stream_tweet', ['created_at'])
开发者ID:michaelbrooks,项目名称:django-twitter-stream,代码行数:8,代码来源:0002_auto__add_index_tweet_analyzed_by__add_index_tweet_created_at.py
示例4: forwards
# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import create_index [as 别名]
def forwards(self, orm):
# Adding field 'Event.last_update'
db.add_column(u'backoffice_event', 'last_update',
self.gf('django.db.models.fields.DateTimeField')(
default=datetime.datetime.now),
keep_default=False)
db.create_index('backoffice_event', ['last_update'])
示例5: forwards
# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import create_index [as 别名]
def forwards(self, orm):
# Adding index on 'Speaker', fields ['email']
db.create_index(u'pyconkr_speaker', ['email'])
示例6: forwards
# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import create_index [as 别名]
def forwards(self, orm):
pass
# Adding index on 'FollowCategory', fields ['user']
#db.create_index('canvas_followcategory', ['user_id'])
示例7: forwards
# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import create_index [as 别名]
def forwards(self, orm):
db.create_index('canvas_comment', ['category_id', 'score'])
示例8: forwards
# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import create_index [as 别名]
def forwards(self, orm):
# Adding index on 'CommentPin', fields ['comment_id', 'user_id']
db.create_index('canvas_commentpin', ['comment_id', 'user_id'])
示例9: forwards
# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import create_index [as 别名]
def forwards(self, orm):
db.create_index('canvas_post', ['thread_id', 'post_id', 'hidden'])
db.create_index('canvas_post', ['content_id', 'blacklisted', 'hidden', 'timestamp'])
db.create_index('canvas_post', ['author_id', 'anonymous', 'blacklisted', 'hidden', 'timestamp'])
示例10: forwards
# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import create_index [as 别名]
def forwards(self, orm):
db.create_index('canvas_post', ['thread_id', 'post_id'], unique='true')
db.create_index('canvas_post', ['content_id', 'timestamp'])
db.create_index('canvas_post', ['author_id', 'anonymous', 'timestamp'])
示例11: forwards
# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import create_index [as 别名]
def forwards(self, orm):
db.create_index('canvas_content', ['score', 'timestamp'])