Module ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias Import alias Assign NameStore Call AttributeLoad NameLoad attr Str ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults body TryExcept body Expr Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr Str handlers ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad Return Call AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults kwarg body Expr Str If CompareEq AttributeLoad NameLoad attr Str body Return NameLoad ImportFrom alias Assign NameStore BoolOpOr Call AttributeLoad AttributeLoad NameLoad attr attr Str Call AttributeLoad AttributeLoad NameLoad attr attr Str Assign NameStore BoolOpOr Call AttributeLoad AttributeLoad NameLoad attr attr Str Call AttributeLoad AttributeLoad NameLoad attr attr Str If BoolOpOr UnaryOpNot NameLoad UnaryOpNot NameLoad body If UnaryOpNot NameLoad body Expr Call AttributeLoad NameLoad attr Str orelse If UnaryOpNot NameLoad body Expr Call AttributeLoad NameLoad attr Str Return Call AttributeLoad NameLoad attr TryExcept body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad handlers ExceptHandler type TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Str Return Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Return Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore BinOpMod Str TupleLoad AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad Return NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr If BoolOpAnd NameLoad Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr AttributeLoad NameLoad attr body Return NameLoad Return Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr If BoolOpAnd NameLoad Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr AttributeLoad NameLoad attr body Return NameLoad Return Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr If BoolOpAnd NameLoad Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr AttributeLoad NameLoad attr body Return NameLoad Return Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr If BoolOpAnd NameLoad Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr AttributeLoad NameLoad attr body Return NameLoad Return Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str ClassDef bases body Assign NameStore ListLoad Str Str Assign NameStore ListLoad Str Str Str Assign NameStore Call NameLoad Assign NameStore Call NameLoad Assign NameStore NameLoad Assign NameStore ListLoad Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Raise NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Return ListLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr keyword AttributeLoad NameLoad attr For NameStore AttributeLoad NameLoad attr body If CompareNotIn NameLoad AttributeLoad NameLoad attr body Continue Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Assign NameStore Call NameLoad AttributeLoad Call NameLoad NameLoad NameLoad attr If CompareNotEq NameLoad NameLoad body Assign NameStore Call NameLoad BinOpAdd BinOpMod Str TupleLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr ListLoad NameLoad Str NameLoad NameLoad Raise Call NameLoad keyword Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad kwarg body Expr Str Assign NameStore BoolOpOr NameLoad AttributeLoad NameLoad attr TryExcept body Assign NameStore Call AttributeLoad Call NameLoad NameLoad NameLoad attr keyword NameLoad keyword NameLoad NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr keyword AttributeLoad NameLoad attr Return NameLoad handlers ExceptHandler type NameLoad body Expr Call AttributeLoad NameLoad attr Str NameLoad Raise decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad kwarg body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore BoolOpOr NameLoad AttributeLoad NameLoad attr TryExcept body Assign NameStore Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr keyword AttributeLoad NameLoad attr Return NameLoad handlers ExceptHandler type NameLoad body Expr Call AttributeLoad NameLoad attr Str NameLoad Raise decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad kwarg body Expr Str Assign NameStore BoolOpOr NameLoad AttributeLoad NameLoad attr TryExcept body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr keyword NameLoad Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr ListLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword NameLoad handlers ExceptHandler type NameLoad body Expr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Raise decorator_list FunctionDef arguments args NameParam NameParam defaults kwarg body Expr Str Assign NameStore Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad If CompareEq AttributeLoad NameLoad attr Num body Return Call NameLoad orelse Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad If CompareEq SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Str Str body Assign AttributeStore AttributeLoad NameLoad attr attr AttributeLoad Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr keyword AttributeLoad AttributeLoad NameLoad attr attr attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Return SubscriptLoad Call AttributeLoad NameLoad attr Str Index Num decorator_list decorator_list
N/A tastypie http tastypie.authentication ApiKeyAuthentication tastypie.authorization DjangoAuthorization tastypie.exceptions ImmediateHttpResponse tastypie.resources ModelResource django.http HttpResponse core.models ApiKey N/A logging N/A logger N/A N/A logging getLogger moztrap.model.mtapi MTApiKeyAuthentication N/A ApiKeyAuthentication N/A N/A Authentication that requires our custom api key implementation. get_key N/A N/A self user api_key N/A N/A N/A N/A N/A N/A N/A N/A ApiKey objects get owner user key api_key active True N/A N/A N/A logger debug api key is authorized N/A N/A N/A Exception N/A e N/A N/A N/A N/A logger debug N/A api key is NOT authorized
%s e N/A N/A N/A self _unauthorized N/A True N/A is_authenticated N/A N/A self request N/A kwargs N/A N/A 
        Finds the user and checks their API key. GET requests are always
        allowed.

        This overrides Tastypie's default impl, because we use a User
        proxy class, which Tastypie doesn't find

        Should return either ``True`` if allowed, ``False`` if not or an
        ``HttpResponse`` if you need something custom.
         N/A N/A N/A request method GET N/A N/A True core.auth User N/A username N/A N/A N/A N/A request GET get username N/A N/A N/A request POST get username N/A api_key N/A N/A N/A N/A request GET get api_key N/A N/A N/A request POST get api_key N/A N/A N/A username N/A api_key N/A N/A N/A username N/A N/A N/A N/A logger debug no username N/A N/A N/A api_key N/A N/A N/A N/A logger debug no api key N/A N/A N/A self _unauthorized N/A N/A N/A user N/A N/A N/A User objects get username username N/A N/A N/A N/A N/A User DoesNotExist N/A User MultipleObjectsReturned N/A N/A N/A N/A logger debug user retrieval error N/A N/A N/A self _unauthorized N/A N/A request user user N/A N/A N/A self get_key user api_key N/A N/A MTAuthorization N/A DjangoAuthorization N/A N/A Authorization that allows any user to GET but only users with permissions
    to modify.

    For the methods in here, the parent super().some_method will
    check the permission:

      APP.add_THING

    (for example).

    But we also want to say it's ok if you have the permission:

      APP.manage_THINGs

    Basically, the purpose of this class is to go beyond that you have
    to have the "add_THING" or "change_THING" or "delete_THING" and also
    that it's ok that have the "manage_THINGs" permission.
     permission N/A N/A self N/A N/A N/A This permission should be checked by is_authorized. N/A klass N/A N/A self resource_meta object_class N/A permission N/A %s.manage_%ss N/A N/A N/A klass _meta app_label N/A N/A klass _meta module_name N/A N/A N/A logger debug N/A desired permission %s permission N/A permission N/A property read_detail N/A N/A self object_list bundle N/A N/A N/A klass N/A N/A self base_checks N/A bundle request N/A N/A bundle obj __class__ N/A N/A klass N/A N/A N/A N/A bundle request user has_perm N/A self permission N/A N/A True N/A N/A N/A N/A super MTAuthorization self read_detail object_list bundle N/A create_detail N/A N/A self object_list bundle N/A N/A N/A klass N/A N/A self base_checks N/A bundle request N/A N/A bundle obj __class__ N/A N/A klass N/A N/A N/A N/A bundle request user has_perm N/A self permission N/A N/A True N/A N/A N/A N/A super MTAuthorization self create_detail object_list bundle N/A update_detail N/A N/A self object_list bundle N/A N/A N/A klass N/A N/A self base_checks N/A bundle request N/A N/A bundle obj __class__ N/A N/A klass N/A N/A N/A N/A bundle request user has_perm N/A self permission N/A N/A True N/A N/A N/A N/A super MTAuthorization self update_detail object_list bundle N/A delete_detail N/A N/A self object_list bundle N/A N/A N/A klass N/A N/A self base_checks N/A bundle request N/A N/A bundle obj __class__ N/A N/A klass N/A N/A N/A N/A bundle request user has_perm N/A self permission N/A N/A True N/A N/A N/A N/A super MTAuthorization self delete_detail object_list bundle N/A N/A MTResource N/A ModelResource N/A N/A Implement the common code needed for CRUD API interfaces.

    Child classes must implement the following abstract methods:

    - model (property)

     Meta N/A N/A N/A list_allowed_methods N/A get post N/A detail_allowed_methods N/A get put delete N/A authentication N/A MTApiKeyAuthentication N/A authorization N/A MTAuthorization N/A always_return_data True N/A ordering N/A id N/A model N/A N/A self N/A N/A N/A Model class related to this resource. N/A NotImplementedError N/A property read_create_fields N/A N/A self N/A N/A N/A List of fields that are required for create but read-only for update. N/A N/A N/A property check_read_create N/A N/A self bundle N/A N/A N/A Verify that request isn't trying to change a read-create field. N/A obj N/A N/A self get_via_uri N/A N/A bundle request path request N/A bundle request N/A fk N/A self read_create_fields N/A N/A N/A fk N/A bundle data N/A N/A N/A new_fk_id N/A N/A self _id_from_uri N/A N/A bundle data N/A fk N/A old_fk_id N/A str N/A N/A getattr obj fk id N/A N/A new_fk_id old_fk_id N/A N/A error_message N/A str N/A N/A %s of an existing %s  N/A fk N/A N/A self _meta resource_name may not be changed. N/A N/A N/A logger error N/A N/A join N/A error_message old: %s, new: %s old_fk_id new_fk_id N/A N/A ImmediateHttpResponse response N/A N/A http HttpBadRequest error_message N/A bundle N/A obj_create N/A N/A self bundle request N/A None kwargs N/A N/A Set the created_by field for the object to the request's user N/A request N/A request N/A bundle request N/A N/A N/A bundle N/A N/A N/A super MTResource self obj_create bundle bundle request request kwargs N/A N/A N/A bundle obj created_by N/A request user N/A N/A N/A N/A bundle obj save user N/A request user N/A bundle N/A N/A N/A Exception N/A N/A N/A N/A logger exception error creating %s bundle N/A N/A obj_update N/A N/A self bundle request N/A None kwargs N/A N/A Set the modified_by field for the object to the request's user N/A bundle N/A N/A self check_read_create bundle N/A request N/A request N/A bundle request N/A N/A N/A bundle N/A N/A N/A super MTResource self obj_update bundle kwargs N/A N/A N/A N/A bundle obj save user N/A request user N/A bundle N/A N/A N/A Exception N/A N/A N/A N/A logger exception error updating %s bundle N/A N/A obj_delete N/A N/A self bundle request N/A None kwargs N/A N/A Delete the object.
        The DELETE request may include permanent=True/False in its params
        parameter (ie, along with the user's credentials). Default is False.
         N/A request N/A request N/A bundle request N/A N/A N/A permanent N/A N/A N/A request REQUEST get permanent False N/A obj_id N/A N/A self _id_from_uri N/A request path N/A obj N/A N/A N/A N/A self model objects get id obj_id N/A N/A bundle obj obj N/A N/A N/A self authorized_delete_detail N/A obj bundle N/A N/A N/A obj delete user N/A request user permanent permanent N/A N/A N/A Exception N/A N/A N/A N/A logger exception error deleting %s N/A request path N/A N/A delete_detail N/A N/A self request N/A kwargs N/A N/A Avoid the following error:
        WSGIWarning: Content-Type header found in a 204 response, which not
        return content.
         N/A res N/A N/A N/A super MTResource self delete_detail request kwargs N/A N/A N/A res status_code 204 N/A N/A N/A HttpResponse N/A N/A res N/A save_related N/A N/A self bundle N/A N/A N/A keep it from throwing a ConcurrencyError on obj_update N/A N/A N/A N/A super MTResource self save_related bundle N/A N/A N/A N/A N/A bundle request META N/A REQUEST_METHOD PUT N/A N/A N/A N/A bundle obj cc_version N/A N/A N/A N/A N/A self model objects get id N/A N/A bundle obj id cc_version N/A _id_from_uri N/A N/A self uri N/A N/A N/A N/A N/A N/A uri split / N/A -2 N/A N/A