* A generic stored procedure helper added, and support for calling them. * Order and OrderItem tables added, including helpers and calls to SP for creation and updates. * Minor updates to other repositories.
23 lines
682 B
Python
23 lines
682 B
Python
# -*- coding: utf-8 -*-
|
|
|
|
from pyjeeves.models.raw import PriceList as PriceListModel
|
|
from pyjeeves.models import db
|
|
from sqlalchemy.orm.exc import NoResultFound
|
|
|
|
from pyjeeves import logging
|
|
logger = logging.getLogger("PyJeeves." + __name__)
|
|
|
|
|
|
# Relocate Jeeves modules to separate folder and let a "master" module handle imports, and setup.
|
|
class PriceList():
|
|
"""Handles price lists in Jeeves"""
|
|
|
|
@staticmethod
|
|
def get(price_list_no):
|
|
""" Query a price list by number """
|
|
try:
|
|
return db.raw.query(PriceListModel).filter_by(
|
|
PrisLista=price_list_no
|
|
).one()
|
|
except NoResultFound:
|
|
raise KeyError
|