Пример #1
0
    def start_listeners(cls):
        areas = Area.objects()
        if not areas.count():
            cls.__generate_area()
            return

        for area in areas:
            center = PlaceMsgCenter(slug=area.slug)
            center.start()
Пример #2
0
 def __create(cls, slug, centroid, *args, **kwargs):
     area = cls(slug=slug, centroid=centroid, *args, **kwargs)
     area.save()
     center = PlaceMsgCenter(slug=area.slug)
     center.start()