def get(self, gallery): paintings = Painting.query(ancestor=self.parent_key).filter(Painting.gallery == gallery).fetch() template_values = { 'nav': gallery, 'paintings': paintings, } template = JINJA_ENVIRONMENT.get_template('main/templates/gallery.html') self.response.write(template.render(template_values))
def get(self): paintings = Painting.query(ancestor=self.parent_key).order(-Painting.updated_at).fetch() template_values = { 'paintings': paintings, 'galleries': Painting.CHOICES_GALLERIES, 'tab': self.request.GET.get('tab', 'figures'), } template = JINJA_ENVIRONMENT.get_template('main/templates/admin.html') self.response.write(template.render(template_values))
def get(self): paintings = Painting.query( ancestor=self.parent_key).order(-Painting.updated_at).fetch() template_values = { 'paintings': paintings, 'galleries': Painting.CHOICES_GALLERIES, 'tab': self.request.GET.get('tab', 'figures'), } template = JINJA_ENVIRONMENT.get_template('main/templates/admin.html') self.response.write(template.render(template_values))
def get(self, gallery): paintings = Painting.query(ancestor=self.parent_key).filter( Painting.gallery == gallery).fetch() template_values = { 'nav': gallery, 'paintings': paintings, } template = JINJA_ENVIRONMENT.get_template( 'main/templates/gallery.html') self.response.write(template.render(template_values))
def get(self): paintings = Painting.query(ancestor=self.parent_key).fetch() specials = [painting for painting in paintings if painting.special] originals = [painting for painting in paintings if (not painting.special and not painting.sold)] prints = [painting for painting in paintings if (not painting.special and painting.copy)] template_values = { 'nav': 'available', 'specials': specials, 'originals': originals, 'prints': prints, } template = JINJA_ENVIRONMENT.get_template('main/templates/available.html') self.response.write(template.render(template_values))
def get(self): paintings = Painting.query(ancestor=self.parent_key).fetch() specials = [painting for painting in paintings if painting.special] originals = [ painting for painting in paintings if (not painting.special and not painting.sold) ] prints = [ painting for painting in paintings if (not painting.special and painting.copy) ] template_values = { 'nav': 'available', 'specials': specials, 'originals': originals, 'prints': prints, } template = JINJA_ENVIRONMENT.get_template( 'main/templates/available.html') self.response.write(template.render(template_values))