我有PostgreSQL和Django以及theese模型:
class TranslationService(models.Model):
class Meta:
abstract = True
service_name = models.CharField(max_length=40)
class GoogleTranslator(TranslationService):
service_name = "Google"
lang = models.CharField(max_length=10, blank=False)
text = models.TextField(blank=False)
我想通过TranslatorService
过滤service_name
,但字段不在数据库中,我该如何执行此操作?只在DB中存储字段并设置默认字段?