Search code examples
djangodjango-south

Django model renaming


I have a populated model (There is data in the model I need to preserve/use)named 'FeatureTag' that I need to rename to simply 'Feature'.

class FeatureTag(models.Model):
        name = models.CharField(max_length=48, unique=True)
        data = models.ManyToManyField(Product)
        def __unicode__(self):
                return self.name

3 Questions:

Is this something that can be done with Django?

Is this something that can be done with South?

Is there a way to rename the return statement for the model to reflect a different name?

THANKS!!!!


Solution

  • For your 3 questions:

    • Yes, you can rename your Django's model, just make sure to fix all the references to it.
    • Yes, you can do this with South. You might need to edit the files generated by south - so make sure to check the code that is generated.
    • What function do you want to override and why? What is your use case?