22 lines
763 B
Python
22 lines
763 B
Python
import datetime
|
|
import os
|
|
|
|
SETTING = os.environ['WORKOUTTEST_SETTING']
|
|
if SETTING == "PROD":
|
|
from aitrainer_backoffice.aitrainer_backoffice.models.customer import Customer
|
|
else:
|
|
from aitrainer_backoffice.models.customer import Customer
|
|
|
|
class NotificationHook:
|
|
def __init__(self) -> None:
|
|
pass
|
|
|
|
def NotificationSelectAdmins(self):
|
|
print(datetime.datetime.now(), " *** START automation NotificationSelectAdmins ")
|
|
qs = Customer.objects.raw('SELECT customer_id, firebase_reg_token from customer WHERE admin = 1')
|
|
return qs
|
|
|
|
def NotificationCommonSQL(self, sql):
|
|
print(datetime.datetime.now(), " *** START automation NotificationCommonSQL ")
|
|
qs = Customer.objects.raw(sql)
|
|
return qs |