mirror of
https://codeberg.org/Mo8it/AdvLabDB.git
synced 2024-11-08 21:21:06 +00:00
Add get_count
This commit is contained in:
parent
0c5709d2ab
commit
eba6122aef
1 changed files with 5 additions and 1 deletions
|
@ -1,7 +1,7 @@
|
||||||
from flask import flash, url_for
|
from flask import flash, url_for
|
||||||
from flask_admin.menu import MenuLink
|
from flask_admin.menu import MenuLink
|
||||||
from flask_security import current_user
|
from flask_security import current_user
|
||||||
from sqlalchemy import select
|
from sqlalchemy import func, select
|
||||||
|
|
||||||
from . import app, db
|
from . import app, db
|
||||||
from .models import Semester
|
from .models import Semester
|
||||||
|
@ -83,3 +83,7 @@ def initActiveSemesterMenuLinks(space):
|
||||||
|
|
||||||
def reportBadAttempt(message):
|
def reportBadAttempt(message):
|
||||||
print("BAD ATTEMPT:", message) # TODO: Log
|
print("BAD ATTEMPT:", message) # TODO: Log
|
||||||
|
|
||||||
|
|
||||||
|
def get_count(table):
|
||||||
|
return db.session.scalar(select(func.count()).select_from(table))
|
||||||
|
|
Loading…
Reference in a new issue