docs: def get_extra_restriction(self, where_class, alias, remote_alias):
          """
          Overrides ForeignObject's get_extra_restriction function that returns
          an SQL statement which is appended to a JOIN's conditional filtering
          part
  
          :return: SQL conditional statement
          :rtype: WhereNode
          """
          historic_sql = '''{alias}.version_start_date <= %s
                              AND ({alias}.version_end_date > %s
                                  OR {alias}.version_end_date is NULL )'''
          current_sql = '''{alias}.version_end_date is NULL'''
          # How 'bout creating an ExtraWhere here, without params
          return where_class([VersionedExtraWhere(historic_sql=historic_sql,
                                                  current_sql=current_sql,
                                                  alias=alias,
                                                  remote_alias=remote_alias)])