mirror of
				https://github.com/django/django.git
				synced 2025-11-04 05:35:37 +00:00 
			
		
		
		
	s/get/filter in new example of how to use queryset update method: update won't work on a model instance.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16518 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
		
							parent
							
								
									471a841147
								
							
						
					
					
						commit
						901ea8a68d
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
					@ -1326,7 +1326,7 @@ memory. The former is more efficient. For example, instead of doing this::
 | 
				
			||||||
 | 
					
 | 
				
			||||||
...do this::
 | 
					...do this::
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Entry.objects.get(id=10).update(comments_on=False)
 | 
					    Entry.objects.filter(id=10).update(comments_on=False)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Using ``update()`` instead of loading the object into memory also prevents a
 | 
					Using ``update()`` instead of loading the object into memory also prevents a
 | 
				
			||||||
race condition where something might change in your database in the short
 | 
					race condition where something might change in your database in the short
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue