see: http://code.activestate.com/recipes/325905/
"""
- CACHE_TIME = 300
+ #CACHE_TIME = 300
+
+ #set low for testing
+ CACHE_TIME = 5
@memoize(timeout=CACHE_TIME)
def _item_status(self, bib_id, barcode, bclist, idlist):
if len(allcalls) == 0 and dueid[1] != LOCKED and copy.syrup_id != -1:
dueid = [copy.syrup_id,DUE]
- if copy.part_label:
- alldisplay = '%s - %s (DUE: %s)' % (callno,
- copy.part_label,time.strftime(self.DUE_FORMAT,earliestdue))
- else:
- alldisplay = '%s (DUE: %s)' % (callno,time.strftime(self.DUE_FORMAT,earliestdue))
+ alldisplay = '%s (DUE: %s)' % (callno,time.strftime(self.DUE_FORMAT,earliestdue))
if len(allcalls) > 0:
if allcalls[len(allcalls) - 1][1] != LOCKED:
elif avail >= 1:
avail -= 1
+ if copy.part_label and copy.part_label not in alldisplay:
+ alldisplay = '%s %s (DUE: %s)' % (callno,
+ copy.part_label,time.strftime(self.DUE_FORMAT,earliestdue))
+
elif len(allcalls) > 0:
allcalls[len(allcalls) - 1] = [callno,LOCKED,copy.syrup_id,copy.part_label]
end_term = new_end_term,
owner = sel_site.owner,
service_desk = sel_site.service_desk)
+
_copy_contents(request, sel_site, course_site)
duplicated.append(course_site.pk)
return duplicated
def _copy_contents(request, source_site, dest_site):
item_map = {}
- def process_item(parent, (item, subitems)):
+ def process_item(parent, (item, subitems,extra1,extra2)):
dct = dict((k,v) for k,v in item.__dict__.items() if not k.startswith('_'))
old_id = dct['id']
del dct['id']