本文整理汇总了Python中south.db.db.alter_column函数的典型用法代码示例。如果您正苦于以下问题:Python alter_column函数的具体用法?Python alter_column怎么用?Python alter_column使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了alter_column函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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))
示例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'])
示例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')
示例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']))
示例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