mirror of
				https://github.com/encode/django-rest-framework.git
				synced 2025-11-04 01:47:59 +03:00 
			
		
		
		
	Merge pull request #3896 from m1kola/patch-1
Fixes docstrings in fields.py
This commit is contained in:
		
						commit
						564b1c8268
					
				| 
						 | 
				
			
			@ -117,9 +117,9 @@ def to_choices_dict(choices):
 | 
			
		|||
    """
 | 
			
		||||
    Convert choices into key/value dicts.
 | 
			
		||||
 | 
			
		||||
    pairwise_choices([1]) -> {1: 1}
 | 
			
		||||
    pairwise_choices([(1, '1st'), (2, '2nd')]) -> {1: '1st', 2: '2nd'}
 | 
			
		||||
    pairwise_choices([('Group', ((1, '1st'), 2))]) -> {'Group': {1: '1st', 2: '2nd'}}
 | 
			
		||||
    to_choices_dict([1]) -> {1: 1}
 | 
			
		||||
    to_choices_dict([(1, '1st'), (2, '2nd')]) -> {1: '1st', 2: '2nd'}
 | 
			
		||||
    to_choices_dict([('Group', ((1, '1st'), 2))]) -> {'Group': {1: '1st', 2: '2nd'}}
 | 
			
		||||
    """
 | 
			
		||||
    # Allow single, paired or grouped choices style:
 | 
			
		||||
    # choices = [1, 2, 3]
 | 
			
		||||
| 
						 | 
				
			
			@ -145,8 +145,8 @@ def flatten_choices_dict(choices):
 | 
			
		|||
    """
 | 
			
		||||
    Convert a group choices dict into a flat dict of choices.
 | 
			
		||||
 | 
			
		||||
    flatten_choices({1: '1st', 2: '2nd'}) -> {1: '1st', 2: '2nd'}
 | 
			
		||||
    flatten_choices({'Group': {1: '1st', 2: '2nd'}}) -> {1: '1st', 2: '2nd'}
 | 
			
		||||
    flatten_choices_dict({1: '1st', 2: '2nd'}) -> {1: '1st', 2: '2nd'}
 | 
			
		||||
    flatten_choices_dict({'Group': {1: '1st', 2: '2nd'}}) -> {1: '1st', 2: '2nd'}
 | 
			
		||||
    """
 | 
			
		||||
    ret = OrderedDict()
 | 
			
		||||
    for key, value in choices.items():
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user