Created
February 9, 2022 17:43
-
-
Save mannyanebi/b233202e85f959de86c48acc38648201 to your computer and use it in GitHub Desktop.
You can access the URL kwargs with self.kwargs, so for example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# You can access the URL kwargs with self.kwargs, so for example: | |
def get_object(self, queryset=None): | |
return Employee.objects.get( | |
user=self.request.user, | |
pk=self.kwargs['id'] | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment