本文整理汇总了Python中south.db.db.add_column函数的典型用法代码示例。如果您正苦于以下问题:Python add_column函数的具体用法?Python add_column怎么用?Python add_column使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了add_column函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: forwards
def forwards(self, orm):
# Adding model 'JellyfishIncident'
db.create_table(u'data_jellyfishincident', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('date_observed', self.gf('django.db.models.fields.DateField')()),
('observation_station', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['data.ObservationStation'], on_delete=models.PROTECT)),
('source', self.gf('django.db.models.fields.CharField')(default='W', max_length=2)),
('sting_incidents', self.gf('django.db.models.fields.IntegerField')(default=0, blank=True)),
('total_incidents', self.gf('django.db.models.fields.IntegerField')(default=0, blank=True)),
('created_on', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
('created_by', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='created-incident', null=True, to=orm['auth.User'])),
('updated_on', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
('updated_by', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='updated-incident', null=True, to=orm['auth.User'])),
))
db.send_create_signal(u'data', ['JellyfishIncident'])
# Adding model 'FlagChange'
db.create_table(u'data_flagchange', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('date', self.gf('django.db.models.fields.DateTimeField')()),
('observation_station', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['data.ObservationStation'], on_delete=models.PROTECT)),
('flag_status', self.gf('django.db.models.fields.CharField')(default='N', max_length=1)),
('jellyfish_flag', self.gf('django.db.models.fields.BooleanField')(default=False)),
('created_on', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
('created_by', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='created-flag', null=True, to=orm['auth.User'])),
('updated_on', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
('updated_by', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='updated-flag', null=True, to=orm['auth.User'])),
))
db.send_create_signal(u'data', ['FlagChange'])
# Adding field 'ObservationRoute.use_incident_form'
db.add_column(u'data_observationroute', 'use_incident_form',
self.gf('django.db.models.fields.BooleanField')(default=False),
keep_default=False)
开发者ID:socib,项目名称:grumers,代码行数:34,代码来源:0010_auto__add_jellyfishincident__add_flagchange__add_field_observationrout.py
示例17: forwards
def forwards(self, orm):
# Deleting field 'BlueprintType.researchTechTime'
db.delete_column(u'eve_blueprinttype', 'researchTechTime')
# Deleting field 'BlueprintType.productivityModifier'
db.delete_column(u'eve_blueprinttype', 'productivityModifier')
# Deleting field 'BlueprintType.wasteFactor'
db.delete_column(u'eve_blueprinttype', 'wasteFactor')
# Deleting field 'BlueprintType.materialModifier'
db.delete_column(u'eve_blueprinttype', 'materialModifier')
# Deleting field 'BlueprintType.techLevel'
db.delete_column(u'eve_blueprinttype', 'techLevel')
# Adding field 'BlueprintType.inventionTime'
db.add_column(u'eve_blueprinttype', 'inventionTime',
self.gf('django.db.models.fields.IntegerField')(null=True, blank=True),
keep_default=False)
# Deleting field 'BlueprintReq.extraQuantity'
db.delete_column(u'eve_blueprintreq', 'extraQuantity')
# Deleting field 'BlueprintReq.damagePerJob'
db.delete_column(u'eve_blueprintreq', 'damagePerJob')
开发者ID:Betriebsrat,项目名称:ecm,代码行数:26,代码来源:0004_crius_support.py
示例18: forwards
def forwards(self, orm):
# Adding field 'Defect.application'
db.add_column('defects_defect', 'application', self.gf('django.db.models.fields.related.ForeignKey')(default='1', to=orm['projects.App']), keep_default=False)
# Adding field 'Defect.version'
db.add_column('defects_defect', 'version', self.gf('django.db.models.fields.related.ForeignKey')(default='1', to=orm['projects.Version']), keep_default=False)
开发者ID:GunioRobot,项目名称:central-station,代码行数:7,代码来源:0002_auto__add_field_defect_application__add_field_defect_version.py
示例19: forwards
def forwards(self, orm):
# Adding field 'Company.invited_on'
db.add_column('conference_company', 'invited_on', self.gf('django.db.models.fields.DateField')(null=True, blank=True), keep_default=False)
# Adding field 'Company.invited_by'
db.add_column('conference_company', 'invited_by', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='jobfair_invite', null=True, to=orm['auth.User']), keep_default=False)
开发者ID:Dylnuge,项目名称:liquid,代码行数:7,代码来源:0003_auto__add_field_company_invited_on__add_field_company_invited_by.py
示例20: backwards
def backwards(self, orm):
# Deleting model 'SSProduct'
db.delete_table('commons_core_ssproduct')
# Deleting model 'Dependency'
db.delete_table('commons_core_dependency')
# Deleting model 'SSBudget'
db.delete_table('commons_core_ssbudget')
# Deleting model 'SSDependency'
db.delete_table('commons_core_ssdependency')
# Deleting model 'SSOrganization'
db.delete_table('commons_core_ssorganization')
# Deleting model 'DependencyType'
db.delete_table('commons_core_dependencytype')
# Adding field 'App.ssid'
db.add_column('commons_core_app', 'ssid', self.gf('django.db.models.fields.IntegerField')(default=0), keep_default=False)
# Deleting field 'App.ssp'
db.delete_column('commons_core_app', 'ssp_id')
# Adding field 'Jurisdiction.ssid'
db.add_column('commons_core_jurisdiction', 'ssid', self.gf('django.db.models.fields.IntegerField')(default=0), keep_default=False)
# Deleting field 'Jurisdiction.sso'
db.delete_column('commons_core_jurisdiction', 'sso_id')
# Deleting field 'Jurisdiction.parent'
db.delete_column('commons_core_jurisdiction', 'parent_id')
开发者ID:CivComs,项目名称:commons_site,代码行数:34,代码来源:0004_auto__add_ssproduct__add_dependency__add_ssbudget__add_ssdependency__a.py
注:本文中的south.db.db.add_column函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论