Add "renew" in ICapBook and in boobooks
This commit is contained in:
parent
8c0dbe18f0
commit
bdcc5db8bb
2 changed files with 18 additions and 0 deletions
|
|
@ -64,3 +64,18 @@ class Boobooks(ReplApplication):
|
||||||
}
|
}
|
||||||
|
|
||||||
COLLECTION_OBJECTS = (Book, )
|
COLLECTION_OBJECTS = (Book, )
|
||||||
|
|
||||||
|
def do_renew(self, id):
|
||||||
|
"""
|
||||||
|
renew ID
|
||||||
|
|
||||||
|
Renew a book
|
||||||
|
"""
|
||||||
|
|
||||||
|
id, backend_name = self.parse_id(id)
|
||||||
|
if not id:
|
||||||
|
print >>sys.stderr, 'Error: please give a book ID (hint: use ls command)'
|
||||||
|
return 2
|
||||||
|
names = (backend_name,) if backend_name is not None else None
|
||||||
|
|
||||||
|
self.do('renew_book', id, backends=names)
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,9 @@ class ICapBook(ICapCollection):
|
||||||
def get_booked(self, _id):
|
def get_booked(self, _id):
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|
||||||
|
def renew_book(self, _id):
|
||||||
|
raise NotImplementedError()
|
||||||
|
|
||||||
def get_rented(self, _id):
|
def get_rented(self, _id):
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue