Exemplo n.º 1
0
 def save(self, *args, **kwargs):
     created = self.pk is None
     super().save(*args, **kwargs)
     from mqtt.publish import SingletonPublishClient
     client = SingletonPublishClient()
     client.publish_hospital_equipment(self)
     if created:
         client.publish_hospital_metadata(self.hospital)
Exemplo n.º 2
0
 def delete(self, *args, **kwargs):
     from mqtt.publish import SingletonPublishClient
     client = SingletonPublishClient()
     client.remove_hospital_equipment(self)
     client.publish_hospital_metadata(self.hospital)
     super().delete(*args, **kwargs)