def __init__(self, *args, **kwargs):
        kwargs.setdefault("object_id_field", "object_pk")
        to = getattr(self, "default_related_model", None)
        # Avoid having both a positional arg and a keyword arg for
        # the parameter ``to``
        if to and not args:
            kwargs.setdefault("to", to)
        try:
            # Check if ``related_model`` has been modified by a subclass
            self.related_model
        except (AppRegistryNotReady, AttributeError):
            # if not, all is good
            super(BaseGenericRelation, self).__init__(*args, **kwargs)
        else:
            # otherwise, warn the user to stick to the new (as of 4.0)
            # ``default_related_model`` attribute
            raise ImproperlyConfigured("BaseGenericRelation changed the "
                "way it handled a default ``related_model`` in mezzanine "
                "4.0. Please override ``default_related_model`` instead "
                "and do not tamper with django's ``related_model`` "
                "property anymore.")
Set up some defaults and check for a ``default_related_model``
dataset/ETHPy150Open stephenmcd/mezzanine/mezzanine/generic/fields.py/BaseGenericRelation.__init__