You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create say a UserProfile class which has a One2One relation to the User class, where the id is an integer.
class UserProfile():
user = models.OneToOneField(User, on_delete=models.CASCADE, primary_key=True)
If you define the view set with lookup_field='user_id' then the generated swagger doc defaults the lookup_field as a string instead of integer
class UserProfileViewSet(viewsets.GenericViewSet):
queryset = UserProfile.objects.all()
serializer_class = UserProfileSerializer
lookup_field = 'user_id'
Create say a UserProfile class which has a One2One relation to the User class, where the id is an integer.
If you define the view set with
lookup_field='user_id'
then the generated swagger doc defaults the lookup_field as a string instead of integerclass UserProfileViewSet(viewsets.GenericViewSet):
queryset = UserProfile.objects.all()
serializer_class = UserProfileSerializer
lookup_field = 'user_id'
I'm currently working on a PR for this: #482
The text was updated successfully, but these errors were encountered: