Template Tags

Inclusion Tags

tom_targets.templatetags.targets_extras.recent_targets(context, limit=10)

Displays a list of the most recently created targets in the TOM up to the given limit, or 10 if not specified.

tom_targets.templatetags.targets_extras.target_feature(target)

Displays the featured image for a target.

tom_targets.templatetags.targets_extras.target_data(target)

Displays the data of a target.

tom_targets.templatetags.targets_extras.target_groups(target)

Widget displaying groups this target is in and controls for modifying group association for the given target.

tom_targets.templatetags.targets_extras.target_plan(context, fast_render=False, width=600, height=400, background=None, label_color=None, grid=True)

Displays form and renders plot for visibility calculation. Using this templatetag to render a plot requires that the context of the parent view have values for start_time, end_time, and airmass.

Parameters
  • fast_render (bool) – Render the plot on page load, defaults to the next 24hrs and 2.5 airmass

  • width (int) – Width of generated plot

  • height – Height of generated plot

  • background (str) – Color of the background of generated plot. Can be rgba or hex string.

  • label_color (str) – Color of labels/tick labels. Can be rgba or hex string.

  • grid (bool) – Whether to show grid lines.

tom_targets.templatetags.targets_extras.target_distribution(targets)

Displays a plot showing on a map the locations of all sidereal targets in the TOM.

tom_targets.templatetags.targets_extras.select_target_js()
tom_targets.templatetags.targets_extras.aladin(target)

Displays Aladin skyview of the given target along with basic finder chart annotations including a compass and a scale bar. The resulting image is downloadable. This templatetag only works for sidereal targets.

Filters

tom_targets.templatetags.targets_extras.deg_to_sexigesimal(value, fmt)

Displays a degree coordinate value in sexigesimal, given a format of hms or dms.

tom_targets.templatetags.targets_extras.target_extra_field(target, name)

Returns a TargetExtra value of the given name, if one exists.