当前位置: 首页>>代码示例>>Python>>正文


Python Images.all方法代码示例

本文整理汇总了Python中models.Images.all方法的典型用法代码示例。如果您正苦于以下问题:Python Images.all方法的具体用法?Python Images.all怎么用?Python Images.all使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在models.Images的用法示例。


在下文中一共展示了Images.all方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get

# 需要导入模块: from models import Images [as 别名]
# 或者: from models.Images import all [as 别名]
 def get(self):
     collector = CloudFetch.CloudFetch()     
     urllist = collector.getUrlList()
     #url = 'http://www.technobuffalo.com/wp-content/uploads/2012/12/Google-Apps.jpeg'
     #urllist = urllist.append(url)
     images = Images.all()
     for url in urllist:
         bf = urllib.urlopen(url).read()
         #bf=self.request.get("file")
         if not bf:
             return self.redirect('/')
         #name=self.request.body_file.vars['file'].filename
         #mime = self.request.body_file.vars['file'].headers['content-type']
         #if mime.find('image')==-1:
         #     return self.redirect('/admin/upload/')
         #description=self.request.get("description")
         mime = 'image'
         description = 'Fetched From Cloud'
         name = url.split('/')[len(url.split('/'))-1]
         #DETECT DUPLICATE
         flag = False;
         for i in images:
             if(i.name == name):
                 flag = True
                 break
         if(flag == True):
             continue
         image=methods.addImage( mime, description, bf, name)
     self.redirect('/')
开发者ID:msallk,项目名称:photocollector,代码行数:31,代码来源:admin.py

示例2: index

# 需要导入模块: from models import Images [as 别名]
# 或者: from models.Images import all [as 别名]
 def index(self):
     user_id = cherrypy.session.get('user.id')
     vms = VirtualMachines.find(user_id=user_id)
     env = dict(
         virtual_machines=vms,
         images=Images.all(),
         instance_types=InstanceTypes.all()
     )
     return self.render("virtual_machines/index.html", self.crumbs, **env)
开发者ID:masom,项目名称:Puck,代码行数:11,代码来源:virtual_machines.py

示例3: running

# 需要导入模块: from models import Images [as 别名]
# 或者: from models.Images import all [as 别名]
    def running(self):
        creds = cherrypy.session.get('credentials')
        vms = VirtualMachines.all()
        images = Images.all()
        instances = VirtualMachines.get_instances(creds)
        env = dict(
            virtual_machines=vms,
            instances=instances,
            images=images,
        )

        return self.render("virtual_machines/running.html", self.crumbs,**env)
开发者ID:masom,项目名称:Puck,代码行数:14,代码来源:virtual_machines.py

示例4: index

# 需要导入模块: from models import Images [as 别名]
# 或者: from models.Images import all [as 别名]
 def index(self):
     #Images.add(Images.new(id="test", name="test"))
     env = dict(
         images=Images.all(),
     )
     return self.render("images/index.html", self.crumbs, **env)
开发者ID:masom,项目名称:Puck,代码行数:8,代码来源:images.py

示例5: backup

# 需要导入模块: from models import Images [as 别名]
# 或者: from models.Images import all [as 别名]
 def backup(self):
     images=Images.all().fetch(PAGESIZE)
     while images:
         for image in images:
             self.save(image)
         images = Images.all().filter('__key__ >', images[-1].key()).fetch(PAGESIZE)
开发者ID:fireyy,项目名称:pyasaph,代码行数:8,代码来源:bk.py

示例6: getAllImagesByTag

# 需要导入模块: from models import Images [as 别名]
# 或者: from models.Images import all [as 别名]
def getAllImagesByTag(tag):
    #return db.GqlQuery(u"SELECT * FROM Images WHERE tag=:1",unicode(tag, 'UTF-8'))
    return Images.all().filter('tag =', unicode(tag, 'UTF-8')).order('-created_at') 
开发者ID:studyzy,项目名称:gae_image,代码行数:5,代码来源:methods.py

示例7: getAllImages

# 需要导入模块: from models import Images [as 别名]
# 或者: from models.Images import all [as 别名]
def getAllImages(index=0):
    return Images.all().order('-created_at').fetch(25,index*24)
开发者ID:studyzy,项目名称:gae_image,代码行数:4,代码来源:methods.py

示例8: getImagesBefore

# 需要导入模块: from models import Images [as 别名]
# 或者: from models.Images import all [as 别名]
def getImagesBefore(count=100, lastImage_date=None):
    if lastImage_date:
        return db.GqlQuery("SELECT * FROM Images WHERE created_at < :1 ORDER BY created_at DESC", lastImage_date).fetch(count)
    else:
        return Images.all().order('-created_at').fetch(count)
开发者ID:Letractively,项目名称:code-of-ldmiao,代码行数:7,代码来源:methods.py

示例9: getImages

# 需要导入模块: from models import Images [as 别名]
# 或者: from models.Images import all [as 别名]
def getImages(count=100, offset=0):
    return Images.all().order('-created_at').fetch(count, offset)
开发者ID:Letractively,项目名称:code-of-ldmiao,代码行数:4,代码来源:methods.py


注:本文中的models.Images.all方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。