MCPcopy Create free account
hub / github.com/Dispatcharr/Dispatcharr / ChannelGroup

Class ChannelGroup

apps/channels/models.py:34–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32
33
34class ChannelGroup(models.Model):
35 name = models.TextField(unique=True, db_index=True)
36
37 def related_channels(self):
38 # local import if needed to avoid cyc. Usually fine in a single file though
39 return Channel.objects.filter(channel_group=self)
40
41 def __str__(self):
42 return self.name
43
44 @classmethod
45 def bulk_create_and_fetch(cls, objects):
46 # Perform the bulk create operation
47 cls.objects.bulk_create(objects)
48
49 # Use a unique field to fetch the created objects (assuming 'name' is unique)
50 created_objects = cls.objects.filter(name__in=[obj.name for obj in objects])
51
52 return created_objects
53
54
55class Stream(models.Model):

Callers 1

process_groupsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected