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()
def __create(cls, slug, centroid, *args, **kwargs): area = cls(slug=slug, centroid=centroid, *args, **kwargs) area.save() center = PlaceMsgCenter(slug=area.slug) center.start()