Exemple #1
0
def app_list(request, plat_str, page, context):
    COUNT = 24
    platform = get_platform_id(plat_str)
    query = App.getRecentQuery(platform)
    p = GAEPaginator(query, COUNT)
    context["plat_str"] = plat_str
    context["page"] = page
    context["categories"] = categories
    context["apps"] = p.page(page)
    return render_to_response("webfront/app_list.html", context)
Exemple #2
0
def _recent_app(request, option = {}):
    platform = arrays.get_platform_id(option["plat_str"])
    params = request.GET.copy()
    params["platform"] = platform
    form = apiform.RecentAppForm(params)
    if not form.is_valid():
        return {"status": -1, "thread_id":'', "error": form.errors}
    params = form.cleaned_data
    return {
        "status": 1,
        "apps": App.getRecentQuery(platform).fetch(params["count"], offset=params["offset"])
    }
Exemple #3
0
def _developer_apps(request, option={}):
    developer = Developer.getByAlias(option["developer_alias"])
    if not developer:
        return {"status": -2, "error": "invalid developer"}
    platform = arrays.get_platform_id(option["plat_str"])
    params = request.GET.copy()
    params["platform"] = platform
    form = apiform.RecentAppForm(params)
    if not form.is_valid():
        return {"status": -1, "thread_id":'', "error": form.errors}
    params = form.cleaned_data
    app = App.getQueryByDeveloper(developer.key.id(), params["platform"])
    return {
        "status": 1,
        "apps": sorted(app.fetch(params["count"], offset=params["offset"]), key=lambda x:x.created_at, reverse=True)
    }