Exemple #1
0
def _get_thermography(url, date):
    logging.info("%s %s" % (url, date))
    from thermography.models import ThermographyPointDaily
    _thermographies = ThermographyPointDaily.gql(
        "WHERE url=:url AND date=:date", url=url.rstrip('/'),
        date=date).fetch(1)
    logging.info(_thermographies)
    return _thermographies[0] if _thermographies else None
Exemple #2
0
def _get_thermography(url, date):
    logging.info("%s %s" % (url, date))
    from thermography.models import ThermographyPointDaily

    _thermographies = ThermographyPointDaily.gql("WHERE url=:url AND date=:date", url=url.rstrip("/"), date=date).fetch(
        1
    )
    logging.info(_thermographies)
    return _thermographies[0] if _thermographies else None
Exemple #3
0
def thermographies(request):
    if _invalid_configuration(request):
        return _redirect_configuration(request)

    site = None
    _thermographies = None
    if request.args.has_key("site"):
        site = Sites.get(request.args["site"])
        if site.user != request.user:
            return _redirect_configuration(request)
        from thermography.models import ThermographyPointDaily

        _thermographies = ThermographyPointDaily.all().filter("site =", site).order("-date").fetch(1000)

    return render_to_response("admin/thermographies.html", {"site": site, "thermographies": _thermographies})
Exemple #4
0
def thermographies(request):
    if _invalid_configuration(request): return _redirect_configuration(request)

    site = None
    _thermographies = None
    if request.args.has_key('site'):
        site = Sites.get(request.args['site'])
        if site.user != request.user: return _redirect_configuration(request)
        from thermography.models import ThermographyPointDaily
        _thermographies = ThermographyPointDaily.all().filter(
            'site =', site).order('-date').fetch(1000)

    return render_to_response('admin/thermographies.html', {
        "site": site,
        "thermographies": _thermographies
    })
Exemple #5
0
def _get_site_page(url):
    from thermography.models import ThermographyPointDaily
    _thermographies = ThermographyPointDaily.gql("url =",
                                                 url.rstrip('/')).fetch(1)
    return _thermographies[0] if _thermographies else None
Exemple #6
0
def _get_site_page(url):
    from thermography.models import ThermographyPointDaily

    _thermographies = ThermographyPointDaily.gql("url =", url.rstrip("/")).fetch(1)
    return _thermographies[0] if _thermographies else None