A more generic way to create URL based template

    - As mentioned in issue 17, the method used assumes
      that the lookup field is 'pk', but this in fact can
      be anything. This fixes that issue.
      Another issue with the 'reverse¡ approac was that it wouldn't
      match ids which must include dashes or underscores, this
      takes care of that as well
Increasing coverage

    - Added test links when constructing for url templates
      when url are routed using namespaces
py3 support

    - urlparse was moved to urllib.parse in py3
Using six bundled in django to avoid extra deps
Fixes for flake8 issues
Add flake8 to TravisCI checks
Merge pull request #21 from jwhitlock/fix_pep8

Fix PEP8
Merge pull request #19 from holandes22/master

A more generic way to create URL based template
Fix bug w/ linked items in nested resources

In JsonApiMixin.handle_nested_serializer, if the nested resource
contained links, then extra items would be added to the links section,
due to reusing the variable 'linked_ids' in the loop.  This code changes
the loop variable to 'converted_ids'.

The relevant section of the JSON API spec is:

http://jsonapi.org/format/#document-structure-compound-documents

It does not detail what should happen when an included resourse contains
links.  It does say:

> The type of each relationship MAY be specified in a resource-level or
> top- level "links" object with the "type" key. This facilitates
> lookups of linked resource objects by the client.

The previous behaviour was certainly a bug.  Tests are included to
demonstrate current behaviour, and can be amended when / if the JSON API
spec has more details about compound documents.
Only prepend links once

This matches the proposal in json-api/json-api#315