24 lines
610 B
Python
24 lines
610 B
Python
import sys
|
|
import os
|
|
|
|
# Add backend to path
|
|
sys.path.append(os.path.join(os.getcwd(), 'backend'))
|
|
|
|
from core.database import CoreSessionLocal
|
|
from api.v1.modules.a76.general_catalogs.units_of_measure.models import UnitOfMeasure
|
|
|
|
def check_units():
|
|
db = CoreSessionLocal()
|
|
try:
|
|
units = db.query(UnitOfMeasure).limit(10).all()
|
|
print(f"Found {len(units)} units:")
|
|
for u in units:
|
|
print(f"Code: {u.code}, Description: {u.description}")
|
|
except Exception as e:
|
|
print(f"Error: {e}")
|
|
finally:
|
|
db.close()
|
|
|
|
if __name__ == "__main__":
|
|
check_units()
|