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


Python db.shorten_name方法代码示例

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


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

示例1: backwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import shorten_name [as 别名]
def backwards(self, orm):
        # Deleting model 'DocumentSet'
        db.delete_table(u'crowdataapp_documentset')

        # Deleting model 'DocumentSetForm'
        db.delete_table(u'crowdataapp_documentsetform')

        # Removing M2M table for field sites on 'DocumentSetForm'
        db.delete_table(db.shorten_name(u'crowdataapp_documentsetform_sites'))

        # Deleting model 'DocumentSetFormField'
        db.delete_table(u'crowdataapp_documentsetformfield')

        # Deleting model 'DocumentSetFormEntry'
        db.delete_table(u'crowdataapp_documentsetformentry')

        # Deleting model 'Document'
        db.delete_table(u'crowdataapp_document')

        # Deleting model 'DocumentUserFormEntry'
        db.delete_table(u'crowdataapp_documentuserformentry') 
开发者ID:crowdata,项目名称:crowdata,代码行数:23,代码来源:0001_initial.py

示例2: forwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import shorten_name [as 别名]
def forwards(self, orm):
        # Adding model 'Flowbit'
        db.create_table(u'rules_flowbit', (
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('name', self.gf('django.db.models.fields.CharField')(max_length=100)),
            ('set', self.gf('django.db.models.fields.BooleanField')(default=False)),
            ('isset', self.gf('django.db.models.fields.BooleanField')(default=False)),
            ('enable', self.gf('django.db.models.fields.BooleanField')(default=True)),
            ('source', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['rules.Source'])),
        ))
        db.send_create_signal(u'rules', ['Flowbit'])

        # Adding M2M table for field flowbits on 'Rule'
        m2m_table_name = db.shorten_name(u'rules_rule_flowbits')
        db.create_table(m2m_table_name, (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('rule', models.ForeignKey(orm[u'rules.rule'], null=False)),
            ('flowbit', models.ForeignKey(orm[u'rules.flowbit'], null=False))
        ))
        db.create_unique(m2m_table_name, ['rule_id', 'flowbit_id']) 
开发者ID:StamusNetworks,项目名称:scirius,代码行数:22,代码来源:0006_auto__add_flowbit.py

示例3: backwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import shorten_name [as 别名]
def backwards(self, orm):
        # Deleting model 'Event'
        db.delete_table(u'happenings_event')

        # Removing M2M table for field location on 'Event'
        db.delete_table(db.shorten_name(u'happenings_event_location'))

        # Removing M2M table for field categories on 'Event'
        db.delete_table(db.shorten_name(u'happenings_event_categories'))

        # Removing M2M table for field tags on 'Event'
        db.delete_table(db.shorten_name(u'happenings_event_tags'))

        # Deleting model 'Location'
        db.delete_table(u'happenings_location')

        # Deleting model 'Category'
        db.delete_table(u'happenings_category')

        # Deleting model 'Tag'
        db.delete_table(u'happenings_tag') 
开发者ID:wreckage,项目名称:django-happenings,代码行数:23,代码来源:0001_initial.py

示例4: forwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import shorten_name [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

示例5: backwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import shorten_name [as 别名]
def backwards(self, orm):
        # Deleting model 'Organization'
        db.delete_table(u'crowdataapp_organization')

        # Removing M2M table for field users on 'Organization'
        db.delete_table(db.shorten_name(u'crowdataapp_organization_users'))

        # Deleting field 'DocumentSetFormEntry.organization'
        db.delete_column(u'crowdataapp_documentsetformentry', 'organization_id')

        # Deleting field 'UserProfile.current_organization'
        db.delete_column(u'crowdataapp_userprofile', 'current_organization_id') 
开发者ID:crowdata,项目名称:crowdata,代码行数:14,代码来源:0028_auto__add_organization__add_field_documentsetformentry_organization__a.py

示例6: forwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import shorten_name [as 别名]
def forwards(self, orm):
        # Adding M2M table for field user_stars on 'Project'
        m2m_table_name = db.shorten_name(u'api_project_user_stars')
        db.create_table(m2m_table_name, (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('project', models.ForeignKey(orm['api.project'], null=False)),
            ('user', models.ForeignKey(orm[u'auth.user'], null=False))
        ))
        db.create_unique(m2m_table_name, ['project_id', 'user_id']) 
开发者ID:awemulya,项目名称:kobo-predict,代码行数:11,代码来源:0008_auto_add_user_star_field_to_project.py

示例7: backwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import shorten_name [as 别名]
def backwards(self, orm):
        # Removing M2M table for field user_stars on 'Project'
        db.delete_table(db.shorten_name(u'api_project_user_stars')) 
开发者ID:awemulya,项目名称:kobo-predict,代码行数:5,代码来源:0008_auto_add_user_star_field_to_project.py

示例8: backwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import shorten_name [as 别名]
def backwards(self, orm):
        # Deleting model 'ShapeName'
        db.delete_table(u'shapes_shapename')

        # Deleting model 'ShapeSubstance'
        db.delete_table(u'shapes_shapesubstance')

        # Deleting model 'ShapeSubstanceGroup'
        db.delete_table(u'shapes_shapesubstancegroup')

        # Removing M2M table for field names on 'ShapeSubstanceGroup'
        db.delete_table(db.shorten_name(u'shapes_shapesubstancegroup_names'))

        # Deleting model 'MaterialShape'
        db.delete_table(u'shapes_materialshape')

        # Removing M2M table for field submitted_shapes on 'MaterialShape'
        db.delete_table(db.shorten_name(u'shapes_materialshape_submitted_shapes'))

        # Deleting model 'SubmittedShape'
        db.delete_table(u'shapes_submittedshape')

        # Deleting model 'ShapeSubstanceLabel'
        db.delete_table(u'shapes_shapesubstancelabel')

        # Deleting model 'MaterialShapeNameLabel'
        db.delete_table(u'shapes_materialshapenamelabel')

        # Deleting model 'ShapePlanarityLabel'
        db.delete_table(u'shapes_shapeplanaritylabel')

        # Deleting model 'MaterialShapeQuality'
        db.delete_table(u'shapes_materialshapequality')

        # Deleting model 'MaterialShapeNicenessLabel'
        db.delete_table(u'shapes_materialshapenicenesslabel') 
开发者ID:seanbell,项目名称:opensurfaces,代码行数:38,代码来源:0001_initial.py

示例9: forwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import shorten_name [as 别名]
def forwards(self, orm):
        # Adding model 'MyUser'
        db.create_table(u'accounts_myuser', (
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('password', self.gf('django.db.models.fields.CharField')(max_length=128)),
            ('last_login', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime.now)),
            ('is_superuser', self.gf('django.db.models.fields.BooleanField')(default=False)),
            ('first_name', self.gf('django.db.models.fields.CharField')(max_length=30, blank=True)),
            ('last_name', self.gf('django.db.models.fields.CharField')(max_length=30, blank=True)),
            ('email', self.gf('django.db.models.fields.EmailField')(unique=True, max_length=255)),
            ('is_staff', self.gf('django.db.models.fields.BooleanField')(default=False)),
            ('is_active', self.gf('django.db.models.fields.BooleanField')(default=True)),
            ('date_joined', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime.now)),
            ('is_verified', self.gf('django.db.models.fields.BooleanField')(default=False)),
            ('date_of_birth', self.gf('django.db.models.fields.DateField')(null=True, blank=True)),
        ))
        db.send_create_signal(u'accounts', ['MyUser'])

        # Adding M2M table for field groups on 'MyUser'
        m2m_table_name = db.shorten_name(u'accounts_myuser_groups')
        db.create_table(m2m_table_name, (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('myuser', models.ForeignKey(orm[u'accounts.myuser'], null=False)),
            ('group', models.ForeignKey(orm[u'auth.group'], null=False))
        ))
        db.create_unique(m2m_table_name, ['myuser_id', 'group_id'])

        # Adding M2M table for field user_permissions on 'MyUser'
        m2m_table_name = db.shorten_name(u'accounts_myuser_user_permissions')
        db.create_table(m2m_table_name, (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('myuser', models.ForeignKey(orm[u'accounts.myuser'], null=False)),
            ('permission', models.ForeignKey(orm[u'auth.permission'], null=False))
        ))
        db.create_unique(m2m_table_name, ['myuser_id', 'permission_id']) 
开发者ID:celiao,项目名称:django-rest-authemail,代码行数:37,代码来源:0001_initial.py

示例10: backwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import shorten_name [as 别名]
def backwards(self, orm):
        # Deleting model 'MyUser'
        db.delete_table(u'accounts_myuser')

        # Removing M2M table for field groups on 'MyUser'
        db.delete_table(db.shorten_name(u'accounts_myuser_groups'))

        # Removing M2M table for field user_permissions on 'MyUser'
        db.delete_table(db.shorten_name(u'accounts_myuser_user_permissions')) 
开发者ID:celiao,项目名称:django-rest-authemail,代码行数:11,代码来源:0001_initial.py

示例11: backwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import shorten_name [as 别名]
def backwards(self, orm):
        # Deleting model 'Flowbit'
        db.delete_table(u'rules_flowbit')

        # Removing M2M table for field flowbits on 'Rule'
        db.delete_table(db.shorten_name(u'rules_rule_flowbits')) 
开发者ID:StamusNetworks,项目名称:scirius,代码行数:8,代码来源:0006_auto__add_flowbit.py

示例12: forwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import shorten_name [as 别名]
def forwards(self, orm):
        # Deleting model 'Reference'
        db.delete_table(u'rules_reference')

        # Adding model 'SourceUpdate'
        db.create_table(u'rules_sourceupdate', (
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('source', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['rules.Source'])),
            ('created_date', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime(2014, 7, 31, 0, 0), blank=True)),
            ('data', self.gf('django.db.models.fields.TextField')()),
            ('version', self.gf('django.db.models.fields.CharField')(max_length=42)),
        ))
        db.send_create_signal(u'rules', ['SourceUpdate'])


        # Changing field 'Source.uri'
        db.alter_column(u'rules_source', 'uri', self.gf('django.db.models.fields.CharField')(max_length=400, null=True))
        # Deleting field 'Rule.id'
        db.delete_column(u'rules_rule', u'id')

        # Removing M2M table for field references on 'Rule'
        db.delete_table(db.shorten_name(u'rules_rule_references'))


        # Changing field 'Rule.sid'
        db.alter_column(u'rules_rule', 'sid', self.gf('django.db.models.fields.IntegerField')(primary_key=True)) 
开发者ID:StamusNetworks,项目名称:scirius,代码行数:28,代码来源:0003_auto__del_reference__add_sourceupdate__chg_field_source_uri__del_field.py

示例13: backwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import shorten_name [as 别名]
def backwards(self, orm):
        # Adding model 'Reference'
        db.create_table(u'rules_reference', (
            ('value', self.gf('django.db.models.fields.CharField')(max_length=1000)),
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('key', self.gf('django.db.models.fields.CharField')(max_length=100)),
        ))
        db.send_create_signal(u'rules', ['Reference'])

        # Deleting model 'SourceUpdate'
        db.delete_table(u'rules_sourceupdate')


        # Changing field 'Source.uri'
        db.alter_column(u'rules_source', 'uri', self.gf('django.db.models.fields.CharField')(default=1, max_length=400))
        # Adding field 'Rule.id'
        db.add_column(u'rules_rule', u'id',
                      self.gf('django.db.models.fields.AutoField')(default=1, primary_key=True),
                      keep_default=False)

        # Adding M2M table for field references on 'Rule'
        m2m_table_name = db.shorten_name(u'rules_rule_references')
        db.create_table(m2m_table_name, (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('rule', models.ForeignKey(orm[u'rules.rule'], null=False)),
            ('reference', models.ForeignKey(orm[u'rules.reference'], null=False))
        ))
        db.create_unique(m2m_table_name, ['rule_id', 'reference_id'])


        # Changing field 'Rule.sid'
        db.alter_column(u'rules_rule', 'sid', self.gf('django.db.models.fields.IntegerField')(unique=True)) 
开发者ID:StamusNetworks,项目名称:scirius,代码行数:34,代码来源:0003_auto__del_reference__add_sourceupdate__chg_field_source_uri__del_field.py

示例14: forwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import shorten_name [as 别名]
def forwards(self, orm):
        # Adding M2M table for field ignore on 'MMCEmail'
        m2m_table_name = db.shorten_name('mmc_mmcemail_ignore')
        db.create_table(m2m_table_name, (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('mmcemail', models.ForeignKey(orm['mmc.mmcemail'], null=False)),
            ('mmcscript', models.ForeignKey(orm['mmc.mmcscript'], null=False))
        ))
        db.create_unique(m2m_table_name, ['mmcemail_id', 'mmcscript_id']) 
开发者ID:LPgenerator,项目名称:django-mmc,代码行数:11,代码来源:0011_auto.py

示例15: backwards

# 需要导入模块: from south.db import db [as 别名]
# 或者: from south.db.db import shorten_name [as 别名]
def backwards(self, orm):
        # Removing M2M table for field ignore on 'MMCEmail'
        db.delete_table(db.shorten_name('mmc_mmcemail_ignore')) 
开发者ID:LPgenerator,项目名称:django-mmc,代码行数:5,代码来源:0011_auto.py


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