django-south

“Duplicate key value” error when running Django tests on auth

十年热恋 提交于 2019-12-22 06:33:46
问题 I have a Django site that's working fine. It has a small amount of data in the database which I want to use for testing. I've done dumpdata to generate a few .json fixtures. But, when I try to run a test on my app ("tagger") I get a Postgresql error, and I can't work out how to solve it: (django-projectname)$ ./manage.py test tagger Creating test database for alias 'default'... Problem installing fixture '/Users/phil/Projects/RIG/projectname/django-projectname/projectname/tagger/fixtures/auth

Django south circular dependency

感情迁移 提交于 2019-12-22 04:29:17
问题 I have an app (let's call it MyApp) in a Django 1.5 project. MyApp defines a custom user model (MyUser). The project uses another app (AnotherApp) which references MyUser. MyApp references fields in AnotherApp. Everything has been working fine on my development laptop. I'm attempting to deploy my project on a server, and when I come to the migrate step, MyApp fails due to a dependency to AnotherApp, and AnotherApp fails on a dependency to MyApp (I have tried migrating the apps independently).

South migrate error: name 'UUID' is not defined

末鹿安然 提交于 2019-12-22 03:52:12
问题 I have a model with a CharField field with a default value of uuid4: f = models.CharField(default=uuid4, max_length=36, unique=True, blank=True) and this is causing the following error: Cannot successfully create field 'f' for model 'm': name 'UUID' is not defined. running the migrate commmand! Ho can I fix this issue? so far I tried: to define a "wrapper function" in the module for uuid (ie: def getUUID()) to set the default value of "f" by overriding the Model constructor ...but the problem

There is no South database module 'south.db.postgresql_psycopg2' for your database django

倾然丶 夕夏残阳落幕 提交于 2019-12-22 03:35:48
问题 I have a django app with version as 1.6.5 , i am trying to upgrade it to 1.8 , but on the way i got the below error right after the django version was increased to 1.8 There is no South database module 'south.db.postgresql_psycopg2' for your database. Please either choose a supported database, check for SOUTH_DATABASE_ADAPTER[S] settings, or remove South from INSTALLED_APPS. Code INSTALLED_APPS = [ 'django_messages', 'avatar', 'tinymce', 'south', 'tracking', ...... ] DATABASES = { 'default':

How to rename a foreignkey field with South?

旧街凉风 提交于 2019-12-22 02:03:25
问题 Renaming a simple charfield etc seems easy (Django - How to rename a model field using South?) However when I try using the same on a ForeignKey field I get an error: _mysql_exceptions.OperationalError: (1091, "Can't DROP '[new_fkey_field_name]'; check that column/key exists") Which stems from the migration trying to run the backwards for some reason (as evidenced in the trace). Any ideas? 回答1: Update: with mysql-5.5.30-1.fc18.x86_64 and MySQL-python==1.2.4 Django==1.4.2 South==0.7.6 the

How to disable south debug logging in django?

亡梦爱人 提交于 2019-12-22 02:02:30
问题 When I run my tests in Django, after a fail I got several pages of debug output from South, like these: south: DEBUG: south execute "CREATE INDEX "sometable_4d5bad5" ON "video_playable" ("network_id");" with params "[]" south: DEBUG: south execute "CREATE INDEX "sometable_790e6d98" ON "video_playable" ("published");" with params "[]" south: DEBUG: south execute "CREATE INDEX "sometable_72312277" ON "video_playable" ("archived");" with params "[]" And with all this logging output, the relevant

Using Django, South and Sqlite during development [closed]

断了今生、忘了曾经 提交于 2019-12-21 21:18:23
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I'm new to Python (2.7) and Django (1.5) and am working through the Django book whilst making a hobby site. I'm using Sqlite3 as dev db, but in production I intend to us MySQL. South looks like a great solution for database schema migration management, but it doesn't play well with Sqlite. I'm now tempted to

South migration for multi-table inheritance

三世轮回 提交于 2019-12-21 13:01:05
问题 I have a two models that previously inherited from models.Model and now I've refactored them to inherit from the same base model. Django is using multi-table inheritance for this and I'm trying to generate a schema and data migration for this. There is existing data in the database which needs to be migrated . I know that Django creates a OneToOneField, but I don't understand how it affects existing items in the database. Before Inheritance class BlogPost(models.Model): name = models

Migrate Django model to unique_together constraint

好久不见. 提交于 2019-12-21 03:58:26
问题 I have a model with three fields class MyModel(models.Model): a = models.ForeignKey(A) b = models.ForeignKey(B) c = models.ForeignKey(C) I want to enforce a unique constraint between these fields, and found django's unique_together , which seems to be the solution. However, I already have an existing database, and there are many duplicates. I know that since unique_together works at the database level, I need to unique-ify the rows, and then try a migration. Is there a good way to go about

What value do I use for _ptr when migrating reparented classes with South?

一个人想着一个人 提交于 2019-12-21 03:52:06
问题 I have two classes, one of which is descended from the other, and I would like to make them both sibling classes descended from the same base class. Before: from django.db import models class A(models.Model): name = models.CharField(max_length=10) class B(models.Model): title = models.CharField(max_length=10) After: from django.db import models class Base(models.Model): name = models.CharField(max_length=10) class A(Base): pass class B(Base): title = models.CharField(max_length=10) When I