1+ # encoding: utf-8
12from django .db import models
23
3- class Picture (models .Model ):
44
5- # This is a small demo using just two fields. The slug field is really not
6- # necessary, but makes the code simpler. ImageField depends on PIL or
7- # pillow (where Pillow is easily installable in a virtualenv. If you have
8- # problems installing pillow, use a more generic FileField instead.
5+ class Picture (models .Model ):
6+ """This is a small demo using just two fields. The slug field is really not
7+ necessary, but makes the code simpler. ImageField depends on PIL or
8+ pillow (where Pillow is easily installable in a virtualenv. If you have
9+ problems installing pillow, use a more generic FileField instead.
910
10- #file = models.FileField(upload_to="pictures")
11+ """
1112 file = models .ImageField (upload_to = "pictures" )
1213 slug = models .SlugField (max_length = 50 , blank = True )
1314
@@ -22,7 +23,7 @@ def save(self, *args, **kwargs):
2223 self .slug = self .file .name
2324 super (Picture , self ).save (* args , ** kwargs )
2425
25- # remove to leave file.
2626 def delete (self , * args , ** kwargs ):
27+ """delete -- Remove to leave file."""
2728 self .file .delete (False )
2829 super (Picture , self ).delete (* args , ** kwargs )
0 commit comments