mirror of
				https://github.com/encode/django-rest-framework.git
				synced 2025-11-04 01:47:59 +03:00 
			
		
		
		
	Update 1-serialization.md (#6781)
Assigning a sorted list to STYLE_CHOICES by using a list comprehension.
This commit is contained in:
		
							parent
							
								
									989aeca205
								
							
						
					
					
						commit
						a3eeeb20e7
					
				| 
						 | 
					@ -60,7 +60,7 @@ For the purposes of this tutorial we're going to start by creating a simple `Sni
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    LEXERS = [item for item in get_all_lexers() if item[1]]
 | 
					    LEXERS = [item for item in get_all_lexers() if item[1]]
 | 
				
			||||||
    LANGUAGE_CHOICES = sorted([(item[1][0], item[0]) for item in LEXERS])
 | 
					    LANGUAGE_CHOICES = sorted([(item[1][0], item[0]) for item in LEXERS])
 | 
				
			||||||
    STYLE_CHOICES = sorted((item, item) for item in get_all_styles())
 | 
					    STYLE_CHOICES = sorted([(item, item) for item in get_all_styles()])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    class Snippet(models.Model):
 | 
					    class Snippet(models.Model):
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user