1

I'm running into an error using South migrations on Django. I've included a couple of new fields in my model. I can run python manage.py syncdb and python manage.py schemamigrations retailers but when I try to migrate I run into...

FATAL ERROR - The following SQL query failed: CREATE TABLE "retailers_tag" ("id" integer NOT NULL PRIMARY KEY, "name" varchar(100) NOT NULL, "slug" varchar(50) NOT NULL UNIQUE)
The error was: table "retailers_tag" already exists
ValueError: Cannot import the required field 'autoslug.fields.AutoSlugField'

My model is below:

from django.db import models
from django_extensions.db.fields import AutoSlugField

class Tag(models.Model):
    tag = models.CharField(max_length=100)
    slug = AutoSlugField(populate_from='name', unique=True)

    def __unicode__(self):
        return self.tag

class City(models.Model):
    city = models.CharField(max_length=100)
    slug = AutoSlugField(populate_from='name', unique=True)

    def __unicode__(self):
        return self.city

class Listings(models.Model):
    listing = models.CharField(max_length=50)
    description = models.CharField(max_length=500)
    email = models.EmailField(max_length=75)
    url = models.URLField(max_length = 200)
    tag = models.ManyToManyField(Tag)
    city = models.ManyToManyField(City)
    pub_date = models.DateTimeField(auto_now=True)


    def __unicode__(self):
        return self.listing 

I'm a newbie at Django / South! Thanks in advance for your help.

Suraj Kapoor
  • 1,615
  • 4
  • 22
  • 34
  • 1
    For anyone who runs across the same issue, I found the solution [here][1] [1]: http://stackoverflow.com/questions/4119039/no-such-column-error-in-django-app-after-south-migration – Suraj Kapoor Jun 27 '13 at 22:55

0 Answers0