def edit(req, pk): trigger = get_object_or_404(FeedbackTrigger, pk=pk) return render_to_response(req, "feedback/edit.html", { "trigger": trigger, "all_tags": Tag.objects.all(), "triggers": paginated(req, FeedbackTrigger.objects.all()) })
def view_location_type(req, location_type_slug): # look up the location type by the slug # (maybe not as concise as the loc_type = get_object_or_404( LocationType, slug=location_type_slug) # prefetch all locations in this loc_type, # since we're going to plot them ALL on the # google map whether or not they're visible all_locations = list(loc_type.locations.all().order_by("code")) return render_to_response(req, "locations/view_location_type.html", { "active_location_type_tab": loc_type.pk, "locations": paginated(req, all_locations, prefix="loc", wrapper=with_related_objects), "relations": related_objects(Location), "all_locations": all_locations, "location_type": loc_type })
def index(req): return render_to_response(req, "feedback/index.html", { "triggers": paginated(req, FeedbackTrigger.objects.all()) })