magpie.api.management.group.group_formats

Functions

format_group(→ magpie.typedefs.JSON)

Obtains the JSON formatted Group definition according to field selection flags.

Module Contents

magpie.api.management.group.group_formats.format_group(group: magpie.models.Group, basic_info: bool = False, public_info: bool = False, dotted: bool = False, db_session: sqlalchemy.orm.session.Session | None = None) magpie.typedefs.JSON[source]

Obtains the JSON formatted Group definition according to field selection flags.

Parameters:
  • group – Group for which to provide details.

  • basic_info – If True, return only sufficient details to identify the group (useful for routes that refer to a group, but that are not requesting it specifically), or return full details (for routes that specifically request its information, e.g.: GET /groups/{grp}).

  • public_info – Indicate if the returned details are intended for public information (True) or admin-only (False). Only higher level users should be provided additional details to avoid leaking potentially sensitive parameters.

  • dotted – Employ a dot (.) instead of underscore (_) to separate Group from its basic information.

  • db_session – Database connection to retrieve additional details (required when public_info=False).