Commits

Anonymous committed f22bc83

修正10M图片上传

Comments (0)

Files changed (3)

 *.wpr
 *.sw*
 *~
+
+syntax: regexp
+^\.idea/
   - name: album
   - name: created
     direction: desc
+
+- kind: ImageBF
+  properties:
+  - name: image
+  - name: vid
     def body(self):
         if self.bf:
             return self.bf
-        bfs = ImageBF.all().filter('image =',self).order('__key__')
-        return ''.join([f.bf for f in bfs])
+        bfs = ImageBF.all().filter('image =',self)
+        bf = bfs.order('vid').fetch(10)
+        if not bf:
+            bf = self.bfs
+        return ''.join([f.bf for f in bf])
     
     @property
     def des(self):
         else:
             img = Image(album=album,name=name,mime=mime,key_name = key_name,size=size,**kwargs)
             while start<img.size:
-                ibf = ImageBF(bf=bf[start:start+splitelen],image = img)
+                ibf = ImageBF(bf=bf[start:start+splitelen],image = img,vid = start)
                 ibf.put()
                 start+=splitelen
             
     '''Image binary file'''
     bf = db.BlobProperty()
     image = db.ReferenceProperty(Image,collection_name='bfs')
+    vid = db.IntegerProperty(default=0)
     
 class Counter(db.Model):
     '''