kopia lustrzana https://github.com/wagtail/wagtail
				
				
				
			Add missing null=True and imports to modeladmin example code
							rodzic
							
								
									5e5484d4d7
								
							
						
					
					
						commit
						d731ea6c9f
					
				|  | @ -80,11 +80,16 @@ to create, view, and edit ``Book`` entries. | |||
| 
 | ||||
| .. code-block:: python | ||||
| 
 | ||||
|     from django.db import models | ||||
|     from wagtail.admin.edit_handlers import FieldPanel | ||||
|     from wagtail.images.edit_handlers import ImageChooserPanel | ||||
| 
 | ||||
|     class Book(models.Model): | ||||
|         title = models.CharField(max_length=255) | ||||
|         author = models.CharField(max_length=255) | ||||
|         cover_photo = models.ForeignKey( | ||||
|             'wagtailimages.Image', | ||||
|             null=True, blank=True, | ||||
|             on_delete=models.SET_NULL, | ||||
|             related_name='+' | ||||
|         ) | ||||
|  |  | |||
		Ładowanie…
	
		Reference in New Issue
	
	 Matt Westcott
						Matt Westcott