def inprocess_order_list(): """Returns a formatted list of in-process orders""" inprocess = unicode(ORDER_STATUS[2][0]) orders = orders_at_status(inprocess) return { 'orders' : orders, 'multihost' : is_multihost_enabled() }
def pending_order_list(): """Returns a formatted list of pending orders""" pending = unicode(ORDER_STATUS[1][0]) orders = orders_at_status(pending) return { 'orders' : orders, 'multihost' : is_multihost_enabled() }
def order_lists(): """ Show all orders that are in status' that have display set to True """ status = [] for s in Status.objects.filter(display=True): value = 0 for order in s.orders(): value += order.total status.append((s, value)) return { 'status': status, 'multihost' : is_multihost_enabled() }
def admin_site_views(view): """Returns a formatted list of sites, rendering for view, if any""" configs = Config.objects.all() if view: path = urlresolvers.reverse(view) else: path = None links = [] for config in configs: paths = ["http://", config.site.domain] if path: paths.append(path) links.append((config.store_name, url_join(paths))) ret = {'links': links, 'multihost': is_multihost_enabled()} return ret
def admin_site_views(view): """Returns a formatted list of sites, rendering for view, if any""" configs = Config.objects.all() if view: path = reverse(view) else: path = None links = [] for config in configs: paths = ["http://", config.site.domain] if path: paths.append(path) links.append((config.store_name, url_join(paths))) ret = {"links": links, "multihost": is_multihost_enabled()} return ret