mirror of
				https://github.com/django/django.git
				synced 2025-11-03 21:25:09 +00:00 
			
		
		
		
	Update docs/topics/class-based-views/index.txt
View class does not have a render_to_response method - so does not make sense for this mixin
This commit is contained in:
		
							parent
							
								
									6e4c984098
								
							
						
					
					
						commit
						e437dd1d6b
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		| 
						 | 
					@ -119,11 +119,11 @@ For example, a simple JSON mixin might look something like this::
 | 
				
			||||||
            # -- can be serialized as JSON.
 | 
					            # -- can be serialized as JSON.
 | 
				
			||||||
            return json.dumps(context)
 | 
					            return json.dumps(context)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Now we mix this into the base view::
 | 
					Now we mix this into the base TemplateView::
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    from django.views.generic import View
 | 
					    from django.views.generic import TemplateView
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    class JSONView(JSONResponseMixin, View):
 | 
					    class JSONView(JSONResponseMixin, TemplateView):
 | 
				
			||||||
        pass
 | 
					        pass
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Equally we could use our mixin with one of the generic views. We can make our
 | 
					Equally we could use our mixin with one of the generic views. We can make our
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue