Skip to content
This repository has been archived by the owner on Nov 11, 2020. It is now read-only.

lamby/django-lint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

django-lint

Important notice

This project has been 2008 and was maintained until 2011; it has since been deprecated. If you wish to check out similar functionality, please see:

Ideas

General

  • Default manager with restrictive get_query_set()

  • Oldforms (?)

  • Overriding definition of model. e.g.:

    class MyModel(models.Model):

    : foo = [..]

    foo = [..]

  • Not importing settings via "django.conf import settings"

  • Not using reverse (or @permalink) in get_absolute_url (?)

  • Form definitions in models.py

  • Ignore tests

Models

  • Don't count ManyToMany fields on a model as a field

Remove common prefix checking. models.. specifying "objects = " should be last

Views

  • Calling request.is_authenticated without actually calling
function
  • order_by('?')
  • request.method.upper is a no-op (etc.)
  • cache.set without a timeout

URLS

  • Unreversible urlpatterns

Layout

  • Form class not in forms.py
  • Admin class not in admin.py

Templates

  • {% if foo %}{{ foo }}{% else %}bar{% endif %} => {{ foo|default:"bar" }}
  • {% with foo as bar %} ... [ not using {{ bar }} ] ... {% endwith %}
  • {% endblock %} vs. {% endblock blockname %}

Settings

  • Ordering of MIDDLEWARE_CLASSES
  • TEMPLATE_DIRS not absolute

Layout

  • forms not in forms.py managers not in managers.py