Projects/worblehat-old
Projects
/
worblehat-old
Archived
12
0
Fork 0

Endret litt på utskrift av søkeresultater.

Jeg synes det er fint å ha id-en først på linjen.
This commit is contained in:
Øystein Ingmar Skartsæterhagen 2011-03-06 19:36:38 +00:00
parent 8fe7e880eb
commit 3d16a43961
1 changed files with 2 additions and 2 deletions

View File

@ -57,12 +57,12 @@ def remove_duplicates(list):
def search_person_cmd(search_strings, search_description=False):
people = search_person(search_strings, search_description)
format = '%-20s %-10s %-70s'
format = '%-10s %-20s %-70s'
for person in people:
name = cut_str(person.first_name+' '+person.last_name, 20)
p_id = cut_str(person.id, 10)
books = cut_str(', '.join(map(lambda x: x.book.title, person.books.all())), 70)
print format % (name,p_id,books)
print format % (p_id, name, books)
def search_person(search_strings, search_description=False):
basic_query=Person.objects.select_related('books__book__alt_titles')