Skip to content
Snippets Groups Projects
Commit 3ab6df44 authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Merge branch 'add-str-method' into 'master'

Add __str__ method to models

See merge request !15
parents 4fbdae98 41ccae56
No related branches found
No related tags found
1 merge request!15Add __str__ method to models
Pipeline #2593 failed
......@@ -35,6 +35,9 @@ class BigBlueButton(models.Model):
_api = None
def __str__(self) -> str:
return self.name
@property
def api(self) -> _BigBlueButton:
"""The real :class:`~bigbluebutton.api.bigbluebutton.BigBlueButton` API object.
......@@ -63,6 +66,9 @@ class BigBlueButtonGroup(models.Model):
_api_group = None
def __str__(self) -> str:
return self.name
@property
def api_group(self) -> _BigBlueButtonGroup:
"""The real :class:`~bigbluebutton.api.bigbluebutton.BigBlueButtonGroup` API object.
......@@ -105,6 +111,9 @@ class Meeting(models.Model):
_meeting = None
def __str__(self) -> str:
return self.name
@classmethod
def from_api(cls, api: _BigBlueButton, meeting: _Meeting) -> "Meeting":
"""Create a persistent meeting object from the live API.
......@@ -225,6 +234,9 @@ class APIToken(models.Model):
guid = models.UUIDField(default=uuid.uuid1, editable=False)
def __str__(self) -> str:
return self.name
def clean(self) -> None:
"""Ensure a user is linked when the user scope is selected."""
if self.scope == "user" and not self.user:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment