2025-01-24 23:35:44 +01:00
|
|
|
import functools
|
2025-05-09 14:57:22 +02:00
|
|
|
|
2025-01-25 22:24:44 +01:00
|
|
|
from snek.model.channel import ChannelModel
|
2025-06-07 05:47:54 +02:00
|
|
|
from snek.model.channel_attachment import ChannelAttachmentModel
|
2025-01-25 22:24:44 +01:00
|
|
|
from snek.model.channel_member import ChannelMemberModel
|
2025-05-09 14:57:22 +02:00
|
|
|
|
|
|
|
|
# from snek.model.channel_message import ChannelMessageModel
|
2025-01-25 22:24:44 +01:00
|
|
|
from snek.model.channel_message import ChannelMessageModel
|
2025-06-07 05:47:54 +02:00
|
|
|
from snek.model.container import Container
|
2025-04-03 08:34:25 +02:00
|
|
|
from snek.model.drive import DriveModel
|
|
|
|
|
from snek.model.drive_item import DriveItemModel
|
|
|
|
|
from snek.model.notification import NotificationModel
|
2025-06-07 05:47:54 +02:00
|
|
|
from snek.model.push_registration import PushRegistrationModel
|
|
|
|
|
from snek.model.repository import RepositoryModel
|
2025-01-24 23:35:44 +01:00
|
|
|
from snek.model.user import UserModel
|
2025-04-03 08:34:25 +02:00
|
|
|
from snek.model.user_property import UserPropertyModel
|
2025-01-25 22:24:44 +01:00
|
|
|
from snek.system.object import Object
|
2025-05-09 14:57:22 +02:00
|
|
|
|
|
|
|
|
|
2025-01-24 14:00:10 +01:00
|
|
|
@functools.cache
|
2025-05-09 14:57:22 +02:00
|
|
|
def get_models():
|
|
|
|
|
return Object(
|
|
|
|
|
**{
|
|
|
|
|
"user": UserModel,
|
|
|
|
|
"channel_member": ChannelMemberModel,
|
|
|
|
|
"channel": ChannelModel,
|
|
|
|
|
"channel_message": ChannelMessageModel,
|
|
|
|
|
"drive_item": DriveItemModel,
|
|
|
|
|
"drive": DriveModel,
|
|
|
|
|
"notification": NotificationModel,
|
|
|
|
|
"user_property": UserPropertyModel,
|
|
|
|
|
"repository": RepositoryModel,
|
2025-05-10 20:38:32 +02:00
|
|
|
"channel_attachment": ChannelAttachmentModel,
|
2025-05-18 19:47:15 +02:00
|
|
|
"container": Container,
|
2025-05-31 19:08:55 +02:00
|
|
|
"push_registration": PushRegistrationModel,
|
2025-05-09 14:57:22 +02:00
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_model(name):
|
|
|
|
|
return get_models()[name]
|