mirror of
				https://github.com/django/django.git
				synced 2025-10-30 17:16:10 +00:00 
			
		
		
		
	[1.6.x] Better migration docs for get_query_set -> get_queryset
This way they won't need to fix things again when get_query_set disappears
Backport of 91e2780dfb from master
			
			
This commit is contained in:
		| @@ -1116,8 +1116,10 @@ you should rename the method and conditionally add an alias with the old name:: | |||||||
| If you are writing a library that needs to call the ``get_queryset`` method and | If you are writing a library that needs to call the ``get_queryset`` method and | ||||||
| must support old Django versions, you should write:: | must support old Django versions, you should write:: | ||||||
|  |  | ||||||
|     method = getattr(some_manager, 'get_queryset', some_manager.get_query_set) |     get_queryset = (some_manager.get_queryset | ||||||
|     method(params) |                     if hasattr(some_manager, 'get_queryset') | ||||||
|  |                     else some_manager.get_query_set) | ||||||
|  |     return get_queryset() # etc | ||||||
|  |  | ||||||
| ``shortcut`` view and URLconf | ``shortcut`` view and URLconf | ||||||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user