def render(self, context): result = self.result location = self.location.resolve(context) web = webs.location_web() context[result] = web.has_svg_file(location) return ''
def show_location_list(context, object_list, sort="location_sort"): request = context['request'] web = webs.location_web() dict = defaults(context) dict['table'] = tables.location(request, web, object_list,request.GET.get(sort)) dict['rows'] = dict['table'].rows dict['web'] = web dict['sort'] = sort return dict
def location_svg(request, object_id): object = get_object_or_404(models.location, pk=object_id) web = webs.location_web() if not web.has_svg_file(object): raise Http404 return render_to_response('lintory/locations/%i.svg'%object.pk, mimetype= "image/svg+xml", context_instance=RequestContext(request,{ 'location': location_lookup() }))
def location_task_list(request, object_id): web = webs.location_web() object = get_object_or_404(models.location, pk=object_id) breadcrumbs = web.get_view_breadcrumbs(object) breadcrumbs.append(webs.breadcrumb(reverse('location_task_list',kwargs={'object_id':object_id}),"tasks")) return render_to_response('lintory/location_tasks.html', { 'object': object, 'breadcrumbs': breadcrumbs, 'todo_hardware_tasks': models.hardware_task.objects.filter(hardware__in=object.get_self_or_children_hardware(),date_complete__isnull=True), },context_instance=RequestContext(request))
def url(self): web = webs.location_web() return web.get_view_url(self.location)
def location_delete(request,object_id): web = webs.location_web() object = get_object_or_404(models.location, pk=object_id) return web.object_delete(request, object)
def location_add(request, object_id): web = webs.location_web() parent = get_object_or_404(models.location, pk=object_id) return web.object_add(request, kwargs={ 'parent': parent })