# Path: django_linter/__pkginfo__.py
# BASE_ID = 52


from pylint.checkers import BaseChecker
from pylint.interfaces import IAstroidChecker
from astroid import Name, CallFunc, AssName, Getattr, Tuple, Subscript
from ..__pkginfo__ import BASE_ID
from __future__ import (absolute_import, division,
                        print_function, unicode_literals)




class ViewsChecker(BaseChecker):
    __implements__ = IAstroidChecker

    name = 'views'
    msgs = {
        'W%s31' % BASE_ID: (
            'is_authenticated is not called',
            'is-authenticated-not-called',
            'Used when is_authenticated method is not called'),
        'W%s32' % BASE_ID: (
            'objects.get is used without catching DoesNotExist',
            'objects-get-without-doesnotexist',
            'Used when Model.objects.get is used without enclosing it '
            'in try-except block to catch DoesNotExist exception.'),
        'W%s33' % BASE_ID: (
            'Fetching model objects only for getting len',
            'fetching-db-objects-len',
            'Used when there is db query that fetches objects from '
            'database only to check the number of returned objects.'),

# Path: django_linter/__pkginfo__.py
# BASE_ID = 52


# Path: django_linter/checkers/views.py
from pylint.checkers import BaseChecker
from pylint.interfaces import IAstroidChecker
from astroid import Name, CallFunc, AssName, Getattr, Tuple, Subscript
from ..__pkginfo__ import BASE_ID

from __future__ import (absolute_import, division,
                        print_function, unicode_literals)




class ViewsChecker(BaseChecker):
    __implements__ = IAstroidChecker

    name = 'views'
    msgs = {
        'W%s31' % BASE_ID: (
            'is_authenticated is not called',
            'is-authenticated-not-called',
            'Used when is_authenticated method is not called'),
        'W%s32' % BASE_ID: (
            'objects.get is used without catching DoesNotExist',
            'objects-get-without-doesnotexist',
            'Used when Model.objects.get is used without enclosing it '
            'in try-except block to catch DoesNotExist exception.'),
        'W%s33' % BASE_ID: (
            'Fetching model objects only for getting len',
            'fetching-db-objects-len',
            'Used when there is db query that fetches objects from '
            'database only to check the number of returned objects.'),

        'W%s34' % BASE_ID: (