django-south

Django GenericRelation fields not available during South migration

℡╲_俬逩灬. 提交于 2019-12-02 05:33:10
问题 In a Django project, I have models defined like this : from django.db import models from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes import generic class TaggedEntry(models.Model): content_type = models.ForeignKey(ContentType) object_id = models.PositiveIntegerField() content_object = generic.GenericForeignKey("content_type", "object_id") class Meta: abstract = True class File(TaggedEntry): name = models.CharField(max_length = 256) # some more fields

Does core django supports migration without django-south or similar app?

折月煮酒 提交于 2019-12-02 05:06:03
Does django consists of a migration concept without south app ? If not why didn't they include it in Django 1.4 ? [ Since, its a must have ] Please help.. No, it doesn't. South is considered as the 'de facto' standard for database migration in Django. Further reading can be found in the Django development wiki. From the version 1.2 release notes: Contrib-01 (Add South to contrib) - general consensus - including that of South's lead developer - is that South isn't yet ready to be a bonafide part of Django. This, most probably, is still valid. South has it's limitations, it still has gaps that

Django GenericRelation fields not available during South migration

好久不见. 提交于 2019-12-02 01:35:48
In a Django project, I have models defined like this : from django.db import models from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes import generic class TaggedEntry(models.Model): content_type = models.ForeignKey(ContentType) object_id = models.PositiveIntegerField() content_object = generic.GenericForeignKey("content_type", "object_id") class Meta: abstract = True class File(TaggedEntry): name = models.CharField(max_length = 256) # some more fields class Folder(models.Model): name = models.CharField(max_length = 200) files = generic.GenericRelation

Migrations in stand alone Django app

半城伤御伤魂 提交于 2019-12-01 06:40:06
How do I makemigrations on a stand alone Django app (ie one that is not part if any project). For example after following: https://docs.djangoproject.com/en/1.8/intro/reusable-apps/ You can do it similar to how you do testing scripts for apps: #!/usr/bin/env python import sys import django from django.conf import settings from django.core.management import call_command settings.configure(DEBUG=True, INSTALLED_APPS=( 'django.contrib.contenttypes', 'your_app', ), ) django.setup() call_command('makemigrations', 'your_app') What I do is to create a mock project, containing only that app, then the

South: Unknown command 'migrate'

梦想与她 提交于 2019-12-01 03:39:35
I'm getting a merciless $ python manage.py migrate Unknown command: 'migrate' Type 'manage.py help' for usage. I pulled the code from github onto a fresh computer. This code is tested and is working on other computers. The entire code runs fine except for the fact I can't run migrations! Installed my virtual environment and ran pip install -r requirements.txt . It installs everything, including South. I can check by running $ python manage.py shell >>> import south >>> south.__version__ '0.7.3' However, when I run the manage.py help , the migrate and schemamigration commands don't appear

South migrate error - relation already exists

久未见 提交于 2019-12-01 02:54:06
Background: After adding djangoratings to my project, I tried running django-admin.py schemamigration djangoratings --initial --settings=myapp.settings.local which resulted in an unknown command error for schemamigration. I tried to resolve this error by adding my project directory to the PYTHONPATH (I'm using virtualenv and virtualenvwrapper). This resolved the unknown command error for schemamigration, but I think I specified one directory above my project directory for the PYTHONPATH and when the initial migration was run for djangoratings, it complained about something to do with whoosh

Adding a “through” table to django field and migrating with South?

风流意气都作罢 提交于 2019-11-30 17:43:41
Seems like this should be "easy" or at least documented somewhere, I just cant find it. Lets say I have a model: class A(models.Model): users = models.ManyToMany('auth.User', blank=True) Now I want to migrate to have a through table to add fields to the ManyToMany relation... class AUsers(models.Model): user = models.ForeignKey('auth.User') a = models.ForeignKey('A') new_field = models.BooleanField() class A(models.Model): users = models.ManyToMany('auth.User', blank=True, through='AUsers') Then I do: % ./manage.py schemamigration app --auto Not totally surprising, it tells me it is going to

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

混江龙づ霸主 提交于 2019-11-30 17:31:40
i new to django and I'm getting this error from south but i don't know what i'm missing. I search for answers but i can't found anything. 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. This is my base_settings: from unipath import Path BASE_DIR = Path(__file__).ancestor(3) SECRET_KEY = 'pp@iz7%bc7%+*11%usf7o@_e&)r2o&^3%zjse)n=6b&w^hem96' DJANGO_APPS = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes',

Django Model Choices

回眸只為那壹抹淺笑 提交于 2019-11-30 14:20:19
I've been stumped by how to make choices within my models for hours. So far I've been having issues with my approved field in the model. I want approved to be 1 of the 3 choices,but what I appear to get is a tuple of all three choices. Within './manage.py shell', I get >>> listing.objects.all()[0].approved ((u'1', u'Awaiting'), (u'2', u'No'), (u'3', u'Yes')) My Model: from django.db import models # Create your models here. class directory(models.Model): name = models.CharField(max_length="50") class listing(models.Model): name = models.CharField(max_length="50") directory = models.ForeignKey

Currently using Django “Evolution”, is “South” better and worth switching?

 ̄綄美尐妖づ 提交于 2019-11-30 10:21:43
问题 I'm currently using Django evolutions to manage my product's database evolutions. It's not perfect but I've learned to live with its flaws. For instance, I always have to copy my production database to test before moving out a new schema because the "evolve" command cannot always evolve a database that was changed in several small migrations (on test I did A->B->C, but A->C will not evolve correctly.) Will South fix all of those problems? Is it worth the effort of learing a new tool? 回答1: I