def __init__(self, **kwargs): # We hard-code the `to` argument for ForeignKey.__init__ dfl = get_model_label(self.default_model_class) if "to" in kwargs.keys(): # pragma: no cover old_to = get_model_label(kwargs.pop("to")) if old_to != dfl: msg = "%s can only be a ForeignKey to %s; %s passed" % (self.__class__.__name__, dfl, old_to) warnings.warn(msg, SyntaxWarning) kwargs["to"] = dfl super(FilerFileField, self).__init__(**kwargs)
def __init__(self, **kwargs): # We hard-code the `to` argument for ForeignKey.__init__ dfl = get_model_label(self.default_model_class) if "to" in kwargs.keys(): # pragma: no cover old_to = get_model_label(kwargs.pop("to")) if old_to != dfl: msg = "%s can only be a ForeignKey to %s; %s passed" % ( self.__class__.__name__, dfl, old_to) warnings.warn(msg, SyntaxWarning) kwargs['to'] = dfl super(FilerFolderField, self).__init__(**kwargs)