from amo.decorators import post_required, allow_cross_site_request from amo.models import manual_order from amo.urlresolvers import get_url_prefix from amo.utils import JSONEncoder from api.authentication import AMOOAuthAuthentication from api.forms import PerformanceForm from api.utils import addon_to_dict, extract_filters from perf.models import (Performance, PerformanceAppVersions, PerformanceOSVersion) from search.views import name_query from versions.compare import version_int ERROR = 'error' OUT_OF_DATE = ugettext_lazy( u"The API version, {0:.1f}, you are using is not valid. " u"Please upgrade to the current version {1:.1f} API.") SEARCHABLE_STATUSES = (amo.STATUS_PUBLIC, amo.STATUS_LITE, amo.STATUS_LITE_AND_NOMINATED) xml_env = jingo.env.overlay() old_finalize = xml_env.finalize xml_env.finalize = lambda x: amo.helpers.strip_controls(old_finalize(x)) # Hard limit of 30. The buffer is to try for locale-specific add-ons. MAX_LIMIT, BUFFER = 30, 10 # "New" is arbitrarily defined as 10 days old. NEW_DAYS = 10
from api.forms import PerformanceForm from api.utils import addon_to_dict, extract_filters from amo.models import manual_order from amo.urlresolvers import get_url_prefix from amo.utils import JSONEncoder from addons.models import Addon, CompatOverride from perf.models import (Performance, PerformanceAppVersions, PerformanceOSVersion) from search.client import (Client as SearchClient, SearchError, SEARCHABLE_STATUSES) from search.views import name_query from search import utils as search_utils ERROR = 'error' OUT_OF_DATE = ugettext_lazy( u"The API version, {0:.1f}, you are using is not valid. " u"Please upgrade to the current version {1:.1f} API.") xml_env = jingo.env.overlay() old_finalize = xml_env.finalize xml_env.finalize = lambda x: amo.helpers.strip_controls(old_finalize(x)) # Hard limit of 30. The buffer is to try for locale-specific add-ons. MAX_LIMIT, BUFFER = 30, 10 # "New" is arbitrarily defined as 10 days old. NEW_DAYS = 10 log = commonware.log.getLogger('z.api')