Group
Represents a group in the Datagrok system. A group can be a collection of other groups, with hierarchical relationships defined through parent-child links. Groups can be personal, hidden, and have admin or non-admin members.
Attributes
| Name | Type | Description |
|---|---|---|
| description | Optional[str] | A description of the group's purpose. |
| personal | bool, optional | Whether this is a personal group of the user (default is False). |
| hidden | bool, optional | Whether this group is hidden from the UI (default is False). |
| name | str | Internal name of the model, used as an identifier. |
| id | Optional[str] | Unique identifier for the model instance. Can be None for new instances. |
| friendly_name | Optional[str] | Human-readable name for display purposes. Defaults to None. |
| created_on | Optional[datetime] | Timestamp indicating when the model was created. Defaults to None. |
| updated_on | Optional[datetime] | Timestamp indicating when the model was last updated. Defaults to None. |
| namespace | Optional[str] | Optional namespace prefix to distinguish models with the same name. Defaults to None. |
Methods
__init__()
from_dict()
Internal method: create a Group from a dictionary (e.g., API response).
Parameters
| Name | Type | Description |
|---|---|---|
| client | Optional[DatagrokClient] | The client used to fetch related entities. |
| data | dict | Group data in dictionary form. |
Returns
| Type | Description |
|---|---|
| Group | The deserialized Group object. |
ALL_USERS()
DEVELOPERS()
TEST()
ADMIN()
SYSTEM()
ADMINISTRATORS()
members()
Get all non-admin members of this group.
Returns
| Type | Description |
|---|---|
| List[Group] | List of non-admin member groups |
admin_members()
Get all admin members of this group.
Returns
| Type | Description |
|---|---|
| List[Group] | List of admin member groups |
memberships()
Get all non-admin memberships of this group.
Returns
| Type | Description |
|---|---|
| List[Group] | List of non-admin membership groups |
admin_memberships()
Get all admin memberships of this group.
Returns
| Type | Description |
|---|---|
| List[Group] | List of admin membership groups |
add_member()
Adds a child group as a member of this group (in-memory only). Group should be save using client to actually add a member.
Parameters
| Name | Type | Description |
|---|---|---|
| group | Group | The group to add as a member |
| is_admin | bool, optional | Whether the new member should have admin privileges, by default False |
to_dict()
Convert the group to a dictionary representation.
Returns
| Type | Description |
|---|---|
| dict | Dictionary containing all group data |