Вы можете сделать topic_id
псевдонимом id
с решением здесь :
class AliasField(models.Field):
def contribute_to_class(self, cls, name, private_only=False):
super(AliasField, self).contribute_to_class(cls, name, private_only=True)
setattr(cls, name, self)
def __get__(self, instance, instance_type=None):
return getattr(instance, self.db_column)
class Topic(models.Model):
text = models.CharField(max_length=200)
date_added = models.DateTimeField(auto_now_add=True)
topic_id = AliasField(db_column='id')