Exemple #1
0
    def get(self):
        "Responds to GET requets with the admin interface"
        # query the datastore for images owned by
        # the current user. You can't see anyone elses images
        # in the admin
        images = Image.all()
        images.filter("user ="******"-date")

        # we are enforcing loggins so we know we have a user
        user = users.get_current_user()
        # we need the logout url for the frontend
        logout = users.create_logout_url("/")

        # prepare the context for the template
        context = {
            "images": images,
            "logout": logout,
        }
        # calculate the template path
        path = os.path.join(os.path.dirname(__file__), 'templates',
            'index.html')
        # render the template with the provided context
        self.response.out.write(template.render(path, context))
Exemple #2
0
    def get(self):
        "Responds to GET requets with the admin interface"
        # query the datastore for images owned by
        # the current user. You can't see anyone elses images
        # in the admin
        images = Image.all()
        images.filter("user ="******"-date")

        # we are enforcing loggins so we know we have a user
        user = users.get_current_user()
        # we need the logout url for the frontend
        logout = users.create_logout_url("/")

        # prepare the context for the template
        context = {
            "images": images,
            "logout": logout,
        }
        # calculate the template path
        path = os.path.join(os.path.dirname(__file__), 'templates',
                            'index.html')
        # render the template with the provided context
        self.response.out.write(template.render(path, context))
Exemple #3
0
 def images(self):
     images = Image.all()
     images.filter('auction = ', self)
     return images
Exemple #4
0
def getImagesByPriceRange(min, max):
    images = Image.query()
    imagesBelow = images.filter(Image.totalPrice <= max)
    imagesAboveBelow = imagesBelow.filter(Image.totalPrice >= min)
    return imagesAboveBelow.fetch()