I'm trying a simple model inheritance:
class Product(models.Model):
creation_date = models.DateTimeField(auto_now_add=True)
class Application(Product):
name = models.CharField(max_length=200)
'makemigrations' asks for a default:
You are trying to add a non-nullable field 'product_ptr' to application without a default; we can't do that (the database needs something to populate existing rows).
I saw here that I could Product an abstract model with a Meta class, but I can't do that since I'm refereing it specifically in other models as an actual model:
class Comment(models.Model):
product = models.ForeignKey('Product', related_name="comments")
Running 'makemigrations' when the database is removed also leads to the same issue.
Anything I can do?
Django 1.9