mirror of
				https://github.com/evraz-hack/backend.git
				synced 2025-11-04 09:37:25 +03:00 
			
		
		
		
	
		
			
				
	
	
		
			15 lines
		
	
	
		
			362 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			15 lines
		
	
	
		
			362 B
		
	
	
	
		
			Python
		
	
	
	
	
	
from django.contrib.auth import get_user_model
 | 
						|
from rest_framework import serializers
 | 
						|
 | 
						|
User = get_user_model()
 | 
						|
 | 
						|
 | 
						|
class UserSerializer(serializers.ModelSerializer):
 | 
						|
    class Meta:
 | 
						|
        model = User
 | 
						|
        fields = ["username", "name", "url"]
 | 
						|
 | 
						|
        extra_kwargs = {
 | 
						|
            "url": {"view_name": "api:user-detail", "lookup_field": "username"}
 | 
						|
        }
 |