mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-24 00:06:16 -04:00
Rename class to be singular
This commit is contained in:
@@ -1,11 +1,11 @@
|
|||||||
from sqlalchemy import desc
|
from sqlalchemy import desc
|
||||||
|
|
||||||
from app import db
|
from app import db
|
||||||
from app.models import Rates
|
from app.models import Rate
|
||||||
|
|
||||||
|
|
||||||
def get_rate_for_type_and_date(notification_type, date_sent):
|
def get_rate_for_type_and_date(notification_type, date_sent):
|
||||||
return db.session.query(Rates).filter(Rates.notification_type == notification_type,
|
return db.session.query(Rate).filter(Rate.notification_type == notification_type,
|
||||||
Rates.valid_from <= date_sent
|
Rate.valid_from <= date_sent
|
||||||
).order_by(Rates.valid_from.desc()
|
).order_by(Rate.valid_from.desc()
|
||||||
).limit(1).first()
|
).limit(1).first()
|
||||||
|
|||||||
@@ -946,7 +946,7 @@ class Event(db.Model):
|
|||||||
data = db.Column(JSON, nullable=False)
|
data = db.Column(JSON, nullable=False)
|
||||||
|
|
||||||
|
|
||||||
class Rates(db.Model):
|
class Rate(db.Model):
|
||||||
__tablename__ = 'rates'
|
__tablename__ = 'rates'
|
||||||
|
|
||||||
id = db.Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
|
id = db.Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
|
||||||
|
|||||||
Reference in New Issue
Block a user