如何在模型混合中引用字段定义中的模型名?在这里,什么会取代model_name:
class CreatedByMixin(models.Model):
class Meta:
abstract = True
created_by = ForeignKey(
User,
verbose_name="Created by",
help_text="User that created the record",
related_name=f"{model_name}_created",
editable=False,
)
这样这个模型上的相关名称是'MyModel_created'?
class MyModel(UserAuditMixin, TimeStampedModel):
class Meta:
db_table_comment = "Participants are the users that are involved in the transcript"
field1 = models.TextField()