Started using 'sqlservice'. Added support for many new tables.
This commit is contained in:
parent
9b7d7db996
commit
b77a7069ce
12 changed files with 390 additions and 125 deletions
22
pyjeeves/repositories/pricelist.py
Normal file
22
pyjeeves/repositories/pricelist.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from pyjeeves.models.raw import PriceList as PriceListModel
|
||||
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 PriceListModel.query.filter_by(
|
||||
PrisLista=price_list_no
|
||||
).one()
|
||||
except NoResultFound:
|
||||
raise KeyError
|
||||
Loading…
Add table
Add a link
Reference in a new issue