コード例 #1
0
ファイル: views.py プロジェクト: gmist/solostyle
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
    )
コード例 #2
0
ファイル: views.py プロジェクト: gmist/solostyle
def admin():
    about = About.get_master_db()
    form = AboutForm(obj=about)
    if request.method == 'POST' and form.validate_on_submit():
        form.populate_obj(about)
        about.put()
        return redirect(url_for('admin.index'))
    return render_template('about/admins/admin.html', form=form)
コード例 #3
0
ファイル: views.py プロジェクト: gmist/solostyle
def index():
    info = About.get_master_db().info
    return render_template(
        'about/index.html',
        html_class='about_page',
        info=info)
コード例 #4
0
ファイル: menu.py プロジェクト: gmist/solostyle
def get_footer_about():
    from apps.about.models import About

    info = About.get_master_db().footer_info
    return render_template("j_env/footer_about.html", info=info)