start project

This commit is contained in:
Hemmat
2026-08-07 21:17:17 +03:30
commit ea1e1eead6
121 changed files with 8108 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
"""ip_registry table (Chapter 06 + Chapter 07 extension).
last_verified_bot_result: NOT in Ch06's literal column list — added in
Chapter 07. last_verified_at alone can't tell a cache hit *what* was
verified, only *when*; this stores the outcome.
"""
from __future__ import annotations
from app.extensions import db
class IPRegistry(db.Model):
__tablename__ = "ip_registry"
ip: str = db.Column(db.String(45), primary_key=True)
first_seen = db.Column(db.DateTime, nullable=False)
last_seen = db.Column(db.DateTime, nullable=False)
total_requests: int = db.Column(db.Integer, nullable=False, default=0)
reputation_score: int = db.Column(db.Integer, nullable=False, default=0)
is_flagged: bool = db.Column(db.Boolean, nullable=False, default=False)
last_verified_at = db.Column(db.DateTime, nullable=True)
last_verified_bot_result: bool | None = db.Column(db.Boolean, nullable=True)