File: README.rst

package info (click to toggle)
python-django-lint 0.13-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 156 kB
  • ctags: 165
  • sloc: python: 638; makefile: 5
file content (57 lines) | stat: -rw-r--r-- 1,140 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
django-lint
"""""""""""

Ideas
=====

 * Default manager with restrictive get_query_set()
 * Oldforms (?)
 * Overring definition of model. Eg:
    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

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.)

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