django-south

What does “Migrating a Django application” mean?

感情迁移 提交于 2020-08-19 04:29:51
问题 I kept thinking a lot about the meaning of migrating a Django app the last few days and heard about migrating Django apps with django-south. Maybe it's just the lack of sufficient English skills (as English is not my native language) or this is one of the things you confront in a programmer's life which are so simple, that it takes a genius to understand them (at first). I've read the translation of 'migrate' in my native language, read the definition of migration on Wikipedia and read "the

Workflow for Using Django South with Multiple Code Branches

一世执手 提交于 2020-05-09 17:46:39
问题 I'm curious as to how other Django devs manage their database migrations with South when developing with multiple code branches. Let me give a sample scenario. Say for example you start you development with your main trunk. You create Branch A from the trunk. At this point, the last migration version for app_1 is 0010. Then you create a migration for app_1 in the trunk that creates a migration file 0011_add_name_column . Meanwhile, in branch A, another developer creates a different migration

What is the difference between south migrations and django migrations?

随声附和 提交于 2020-04-12 12:02:10
问题 Can anyone please explain me the difference between south migrations and django migrations? What advantage/disadvantage one has over another? 回答1: South is a third part django app that added support for migrations before a builtin migration solution was introduced in Django 1.7. Unless you're stuck with a long-dead Django version, there's no reason you should use South at all. FWIW, just checking the south project's page should have answered your question: South has been deprecated. From

django south migration error relation “photo_photo” already exists

爷,独闯天下 提交于 2020-01-25 18:48:20
问题 I am using Django South.I am following the tutorial of http://south.readthedocs.org/en/latest/tutorial/part1.html first of all i want to give some information about my project and the apps. I have a django app namely photo and i have two model namely Photo and UserCommission . these are the models class Photo(models.Model): name = models.CharField(max_length = 100) photo = models.ImageField(upload_to = 'photos', blank=False,null=True) approved = models.BooleanField(default = False) approved

Data Migration from ImageField to ImageField using South

≯℡__Kan透↙ 提交于 2020-01-14 13:07:22
问题 I'm trying for several hours now to do the silliest migration using South, but somehow, I've been failing miserably.. I'm trying to migrate to Sorl-Thumbnail. Here is my transitional model: class Deal(models.Model): image = ImageWithThumbsField(upload_to='deal_images',null=True,blank=True,sizes=(200,150),)) new_image = ImageField(upload_to='new_deal_images',default='deal_images/thumb_deal_noimg.gif') And my foward migration it's this so far: def forwards(self, orm): for deal in orm.Deal

How to add one to one relation field in a existing model through South migration

十年热恋 提交于 2020-01-12 18:37:02
问题 I already have a model, class ModelA( models.Model ): name = models.CharField ( max_length = 255, blank = False ) and i have many entries in it. Now i want to add a field in it, which is user = models.OneToOneField( User ) How do i add this field into ModelA ? Is there any solution other than deleting all previous entries? 回答1: I would use this pattern: Add "user = models.OneToOneField(User, null=True)" to your Model (don't remove the "name" field) run 'manage.py schemamigration --auto'. And

How to add one to one relation field in a existing model through South migration

微笑、不失礼 提交于 2020-01-12 18:35:14
问题 I already have a model, class ModelA( models.Model ): name = models.CharField ( max_length = 255, blank = False ) and i have many entries in it. Now i want to add a field in it, which is user = models.OneToOneField( User ) How do i add this field into ModelA ? Is there any solution other than deleting all previous entries? 回答1: I would use this pattern: Add "user = models.OneToOneField(User, null=True)" to your Model (don't remove the "name" field) run 'manage.py schemamigration --auto'. And

Custom user models and South

本秂侑毒 提交于 2020-01-12 07:34:09
问题 I'm trying to use a custom user model in the most basic way, extending AbstractUser as described at Extending Django’s default User. But, I'm not sure how to properly make this work with South. I'm running into a problem when doing an initial schema migration with Here's what happening: I've got my extended user class, Player , in my class tournaments , which is enabled in settings.INSTALLED_APPS . To perform an initial syncdb , the tournaments app must be enabled. Otherwise I get this error:

Custom user models and South

浪子不回头ぞ 提交于 2020-01-12 07:34:08
问题 I'm trying to use a custom user model in the most basic way, extending AbstractUser as described at Extending Django’s default User. But, I'm not sure how to properly make this work with South. I'm running into a problem when doing an initial schema migration with Here's what happening: I've got my extended user class, Player , in my class tournaments , which is enabled in settings.INSTALLED_APPS . To perform an initial syncdb , the tournaments app must be enabled. Otherwise I get this error: