summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-12-31 10:24:09 -0600
committerDan McGee <dan@archlinux.org>2012-12-31 10:24:21 -0600
commitc37fe107282f1aa4925d6c3eef9b7c1598ab4aa1 (patch)
tree0af3d01eefaf822f8456f4d897aeb72d0d49c468
parent04f23a040a839f4989fdc83afe0f5ad4f72224be (diff)
downloadarchweb-c37fe107282f1aa4925d6c3eef9b7c1598ab4aa1.tar.gz
archweb-c37fe107282f1aa4925d6c3eef9b7c1598ab4aa1.zip
Minor coding style tweaks
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--main/models.py4
-rw-r--r--todolists/models.py2
-rw-r--r--todolists/views.py2
3 files changed, 5 insertions, 3 deletions
diff --git a/main/models.py b/main/models.py
index 39bc555e..7155d360 100644
--- a/main/models.py
+++ b/main/models.py
@@ -270,7 +270,8 @@ class Package(models.Model):
"""
deps = []
arches = None
- # TODO: we can use list comprehension and an 'in' query to make this more effective
+ # TODO: we can use list comprehension and an 'in' query to make this
+ # more effective
for dep in self.depends.all():
pkg = dep.get_best_satisfier(self)
providers = None
@@ -279,6 +280,7 @@ class Package(models.Model):
deps.append({'dep': dep, 'pkg': pkg, 'providers': providers})
# sort the list; deptype sorting makes this tricker than expected
sort_order = {'D': 0, 'O': 1, 'M': 2, 'C': 3}
+
def sort_key(val):
dep = val['dep']
return (sort_order.get(dep.deptype, 1000), dep.name)
diff --git a/todolists/models.py b/todolists/models.py
index e02cdd1a..156b041d 100644
--- a/todolists/models.py
+++ b/todolists/models.py
@@ -73,7 +73,7 @@ class TodolistPackage(models.Model):
comments = models.TextField(null=True, blank=True)
class Meta:
- unique_together = (('todolist','pkgname', 'arch'),)
+ unique_together = (('todolist', 'pkgname', 'arch'),)
get_latest_by = 'created'
def __unicode__(self):
diff --git a/todolists/views.py b/todolists/views.py
index 788d74f2..113b27e7 100644
--- a/todolists/views.py
+++ b/todolists/views.py
@@ -123,7 +123,7 @@ def edit(request, slug):
return redirect(todo_list)
else:
form = TodoListForm(instance=todo_list,
- initial={ 'packages': todo_list.raw })
+ initial={'packages': todo_list.raw})
page_dict = {
'title': 'Edit Todo List: %s' % todo_list.name,