def index(): about = About.get_master_db() about_info = about.short_info galleries = Gallery.query(Gallery.is_public==True).order(-Gallery.created) images = [] for gallery in galleries: for img in gallery.images: if len(images) >= 4: break images.append(img) excursions = ExcursionType.query(ExcursionType.is_public == True).count() hotels = Region.query(Region.is_public == True).count() exhibition_info = ExhibitionInfo.get_master_db().is_public investments = InvestmentInfo.get_master_db().is_public tenancy = TenancyInfo.get_master_db().is_public coach = CoachInfo.get_master_db().is_public soc_widgets = SocWidget.query(SocWidget.is_public == True) return render_template( 'main_page/index.html', html_class='main_page', about=about_info, gallery=images, hotels=hotels, exhibition_info=exhibition_info, excursions=excursions, investments=investments, tenancy=tenancy, coach=coach, soc_widgets=soc_widgets )
def index(): galleries = Gallery.query(Gallery.is_public==True).order(-Gallery.modified) return render_template( 'gallery/index.html', title=u'Галерея', html_class='gallery_page', galleries=galleries)
def admin_gallery(): form = NewGalleryForm() if form.validate_on_submit(): new_gallery = Gallery(name=form.name.data) new_gallery.put() return redirect(url_for('gallery.admin_edit', key_id=new_gallery.key.id())) galleries = Gallery.query().order(-Gallery.created) return render_template('gallery/admin/add.html', title=u'Галерея - администрирование', form=form, galleries=galleries)