def _ensure_required_fields(cls): """ Every ``Group`` model requires a foreign key to the ``Subsession`` model of the same app. """ subsession_model = '{app_label}.Subsession'.format( app_label=cls._meta.app_label) subsession_field = djmodels.ForeignKey(subsession_model, on_delete=models.CASCADE) ensure_field(cls, 'subsession', subsession_field) add_field_tracker(cls)
def _ensure_required_fields(cls): add_field_tracker(cls)