Parcourir la source

[enh] add helper to know if an isp does a technology

Laurent Peuch il y a 9 ans
Parent
commit
2904f2e29d
1 fichiers modifiés avec 7 ajouts et 0 suppressions
  1. 7 0
      ffdnispdb/models.py

+ 7 - 0
ffdnispdb/models.py

@@ -152,6 +152,13 @@ class ISP(db.Model):
                 pass
         return d
 
+    def has_technology(self, technology):
+        for i in self.json["coveredAreas"]:
+            if technology in i["technologies"]:
+                return True
+
+        return False
+
     def __repr__(self):
         return u'<ISP %r>' % (self.shortname if self.shortname else self.name,)