feat: add workspace
This commit is contained in:
@@ -7,7 +7,7 @@ from .base import TimestampedModel
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .target_channel import TargetChannel
|
||||
from .user import User
|
||||
from .workspace import Workspace
|
||||
|
||||
|
||||
class ExternalChannel(TimestampedModel):
|
||||
@@ -18,14 +18,13 @@ class ExternalChannel(TimestampedModel):
|
||||
description = fields.TextField(null=True)
|
||||
subscribers_count = fields.IntField(null=True)
|
||||
|
||||
user: fields.ForeignKeyRelation['User'] = fields.ForeignKeyField(
|
||||
'models.User', related_name='external_channels', on_delete=fields.CASCADE, index=True
|
||||
workspace: fields.ForeignKeyRelation['Workspace'] = fields.ForeignKeyField(
|
||||
'models.Workspace', related_name='external_channels', on_delete=fields.CASCADE, index=True
|
||||
)
|
||||
|
||||
if TYPE_CHECKING:
|
||||
target_channels: fields.ManyToManyRelation['TargetChannel']
|
||||
user_id: UUID
|
||||
workspace_id: UUID
|
||||
|
||||
class Meta:
|
||||
table = 'external_channel'
|
||||
unique_together = (('user_id', 'telegram_id'),)
|
||||
|
||||
Reference in New Issue
Block a user