publishers_18.py 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. def content_add(request, hotspot=False):
  2. active_ref = None
  3. if request.method == "GET":
  4. active_ref = request.GET.get("reference", None)
  5. references = []
  6. # for ref in models.ReferenceGenome.objects.all():
  7. for ref in models.ReferenceGenome.objects.filter(
  8. index_version=settings.TMAP_VERSION
  9. ):
  10. references.append(
  11. {
  12. "long_name": ref.short_name + " - " + ref.name,
  13. "short_name": ref.short_name,
  14. "selected": ref.short_name == active_ref,
  15. }
  16. )
  17. if hotspot:
  18. title = ugettext_lazy("content_add_hotspots.title")
  19. else:
  20. title = ugettext_lazy("content_add_targetregions.title")
  21. return render_to_response(
  22. "rundb/ion_publisher_content_add.html",
  23. {
  24. "hotspot": hotspot,
  25. "references": references,
  26. "Content": labels.Content,
  27. "HotspotsContent": labels.HotspotsContent,
  28. "TargetRegionsContent": labels.TargetRegionsContent,
  29. },
  30. context_instance=RequestContext(request),
  31. )