Endret litt på utskrift av søkeresultater.
Jeg synes det er fint å ha id-en først på linjen.
This commit is contained in:
parent
8fe7e880eb
commit
3d16a43961
|
@ -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')
|
||||
|
|
Reference in New Issue