Submit
Path:
~
/
/
opt
/
cloudlinux
/
venv
/
lib
/
python3.11
/
site-packages
/
pylint_django
/
tests
/
input
/
File Content:
func_noerror_classviews.py
""" Checks that Pylint does not complain about attributes and methods when using Class-based Views """ # pylint: disable=missing-docstring from django.db import models from django.http import JsonResponse from django.views.generic import DetailView, TemplateView, View from django.views.generic.edit import CreateView class BoringView(TemplateView): # ensure that args, kwargs and request are not thrown up as errors def get_context_data(self, **kwargs): return {"request": self.request, "args": self.args, "kwargs": self.kwargs} class JsonGetView(View): def get(self, request, *args, **kwargs): # do something with objects but don't use # self or request return JsonResponse({"rc": 0, "response": "ok"}) class JsonPostView(View): def post(self, request, *args, **kwargs): # do something with objects but don't use # self or request return JsonResponse({"rc": 0, "response": "ok"}) class JsonPutView(View): def put(self, request, *args, **kwargs): # do something with objects but don't use # self or request return JsonResponse({"rc": 0, "response": "ok"}) class JsonPatchView(View): def patch(self, request, *args, **kwargs): # do something with objects but don't use # self or request return JsonResponse({"rc": 0, "response": "ok"}) class JsonDeleteView(View): def delete(self, request, *args, **kwargs): # do something with objects but don't use # self or request return JsonResponse({"rc": 0, "response": "ok"}) class JsonHeadView(View): def head(self, request, *args, **kwargs): # pylint: disable=method-hidden # do something with objects but don't use # self or request return JsonResponse({"rc": 0, "response": "ok"}) class JsonOptionsView(View): def options(self, request, *args, **kwargs): # do something with objects but don't use # self or request return JsonResponse({"rc": 0, "response": "ok"}) class JsonTraceView(View): def trace(self, request, *args, **kwargs): # do something with objects but don't use # self or request return JsonResponse({"rc": 0, "response": "ok"}) class Book(models.Model): name = models.CharField(max_length=100) good = models.BooleanField(default=False) class GetBook(DetailView): model = Book template_name = "books/get.html" http_method_names = ["get"] class CreateBook(CreateView): model = Book template_name = "books/new.html" def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) context["page_title"] = "New book" return context
Submit
FILE
FOLDER
Name
Size
Permission
Action
__pycache__
---
0755
migrations
---
0755
models
---
0755
test_app
---
0755
__init__.py
0 bytes
0644
external_django_tables2_noerror_meta_class.py
426 bytes
0644
external_drf_noerror_serializer.py
228 bytes
0644
external_drf_noerror_serializer.rc
40 bytes
0644
external_factory_boy_noerror.py
1524 bytes
0644
external_factory_boy_noerror.rc
33 bytes
0644
external_model_utils_noerror_override_manager.py
915 bytes
0644
external_model_utils_noerror_override_manager.rc
37 bytes
0644
external_psycopg2_noerror_postgres_fields.py
1626 bytes
0644
external_psycopg2_noerror_postgres_fields.rc
34 bytes
0644
external_tastypie_noerror_foreign_key.py
713 bytes
0644
func_hard_coded_auth_user.py
387 bytes
0644
func_hard_coded_auth_user.txt
260 bytes
0644
func_json_response.py
794 bytes
0644
func_json_response.txt
542 bytes
0644
func_model_does_not_use_unicode_py33.py
405 bytes
0644
func_model_does_not_use_unicode_py33.txt
116 bytes
0644
func_model_no_explicit_unicode_str_compat.py
484 bytes
0644
func_model_no_explicit_unicode_str_compat.txt
114 bytes
0644
func_modelform_exclude.py
239 bytes
0644
func_modelform_exclude.txt
112 bytes
0644
func_noerror_classviews.py
2730 bytes
0644
func_noerror_duplicate_except_doesnotexist.py
524 bytes
0644
func_noerror_factory_post_generation.py
425 bytes
0644
func_noerror_foreign_key_attributes.py
632 bytes
0644
func_noerror_foreign_key_ids.py
443 bytes
0644
func_noerror_foreign_key_key_cls_unbound.py
447 bytes
0644
func_noerror_foreign_key_package.py
359 bytes
0644
func_noerror_foreign_key_sets.py
842 bytes
0644
func_noerror_foreignkeys.py
2220 bytes
0644
func_noerror_form_fields.py
2421 bytes
0644
func_noerror_forms_py33.py
805 bytes
0644
func_noerror_formview_ancestors.py
210 bytes
0644
func_noerror_generic_foreign_key.py
613 bytes
0644
func_noerror_gettext_lazy_format.py
197 bytes
0644
func_noerror_ignore_meta_subclass.py
295 bytes
0644
func_noerror_import_q.py
160 bytes
0644
func_noerror_issue_46.py
211 bytes
0644
func_noerror_managers_return_querysets.py
1110 bytes
0644
func_noerror_manytomanyfield.py
1761 bytes
0644
func_noerror_model_fields.py
3220 bytes
0644
func_noerror_model_methods.py
610 bytes
0644
func_noerror_model_objects.py
472 bytes
0644
func_noerror_model_unicode_callable.py
350 bytes
0644
func_noerror_model_unicode_lambda.py
306 bytes
0644
func_noerror_models_py33.py
680 bytes
0644
func_noerror_protected_meta_access.py
691 bytes
0644
func_noerror_string_foreignkey.py
354 bytes
0644
func_noerror_style_members.py
314 bytes
0644
func_noerror_test_wsgi_request.py
567 bytes
0644
func_noerror_ugettext_lazy_format.py
200 bytes
0644
func_noerror_unicode_py2_compatible.py
441 bytes
0644
func_noerror_urls.py
478 bytes
0644
func_noerror_uuid_field.py
616 bytes
0644
func_noerror_views.py
151 bytes
0644
func_noerror_wsgi.py
380 bytes
0644
func_unused_arguments.py
1262 bytes
0644
func_unused_arguments.txt
148 bytes
0644
N4ST4R_ID | Naxtarrr