aboutsummaryrefslogtreecommitdiff
path: root/src/mailman_pgp/model/sighash.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailman_pgp/model/sighash.py')
-rw-r--r--src/mailman_pgp/model/sighash.py16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/mailman_pgp/model/sighash.py b/src/mailman_pgp/model/sighash.py
index 2dddc02..6511484 100644
--- a/src/mailman_pgp/model/sighash.py
+++ b/src/mailman_pgp/model/sighash.py
@@ -16,7 +16,7 @@
# this program. If not, see <http://www.gnu.org/licenses/>.
""""""
-from sqlalchemy import Column, DateTime, LargeBinary, String
+from sqlalchemy import Column, LargeBinary, String
from mailman_pgp.model.base import Base
@@ -24,19 +24,13 @@ from mailman_pgp.model.base import Base
class PGPSigHash(Base):
""""""
- __tablename__ = "sighash"
+ __tablename__ = 'sighash'
hash = Column(LargeBinary, primary_key=True)
fingerprint = Column(String(50), index=True)
- time = Column(DateTime)
@staticmethod
- def find(hash=None, fingerprint=None):
- kws = {}
- if hash is not None:
- kws['hash'] = hash
- if fingerprint is not None:
- kws['fingerprint'] = fingerprint
- if len(kws) == 0:
+ def hashes(hashes):
+ if hashes is None or len(hashes) == 0:
return None
- return PGPSigHash.query().filter_by(**kws).all()
+ return PGPSigHash.query().filter(PGPSigHash.hash.in_(hashes)).all()