Skip to content

Remove pk_url_kwarg, slug_url_kwarg, slug_field. #1773

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tomchristie opened this issue Aug 18, 2014 · 6 comments · Fixed by #1800
Closed

Remove pk_url_kwarg, slug_url_kwarg, slug_field. #1773

tomchristie opened this issue Aug 18, 2014 · 6 comments · Fixed by #1800

Comments

@tomchristie
Copy link
Member

These were placed on the deprecation path in 2.3, and replaced with lookup_field (and later, lookup_url_kwarg).

The will move from "pending deprecation" to "deprecated" in 2.4.

They need to be removed in 3.0.

@cancan101
Copy link
Contributor

@tomchristie
This is actually causing problems for me when using nested router.

I had been using:

    sites = serializers.HyperlinkedIdentityField(view_name='site-list',
                                                 lookup_field='slug', # Is this needed?
                                                 slug_url_kwarg='company_slug')

to deal with urls that look like:

/companies/<company_slug>/sites/<site_slug>

Now what do I do?

@xordoquy
Copy link
Collaborator

@cancan101 It feels like drf-nested-routers will need an update to reflect this change. One should probably open an issue there about this change.

@cancan101
Copy link
Contributor

I will cross post the issue, but the new set of arguments seems to me to be too limiting to get the old behavior.

@cancan101
Copy link
Contributor

Or is my problem as simple as using lookup_url_kwarg instead of slug_url_kwarg ?

@xordoquy
Copy link
Collaborator

I think you'll have to rename your field as Company:company_slug but that doesn't look good to me either.

@cancan101
Copy link
Contributor

@chibisov does this issue affect your nested router code too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants