Minor coding style tweaks
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
04f23a040a
commit
c37fe10728
@ -270,7 +270,8 @@ def get_depends(self):
|
||||
"""
|
||||
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 @@ def get_depends(self):
|
||||
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)
|
||||
|
@ -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):
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user