Make nested depth deeper to include neccessary info for delivery note within a lot
This commit is contained in:
parent
22e3469129
commit
fdd93b0941
|
@ -57,7 +57,7 @@ class LotView(View):
|
||||||
def one(self, id: uuid.UUID):
|
def one(self, id: uuid.UUID):
|
||||||
"""Gets one action."""
|
"""Gets one action."""
|
||||||
lot = Lot.query.filter_by(id=id).one() # type: Lot
|
lot = Lot.query.filter_by(id=id).one() # type: Lot
|
||||||
return self.schema.jsonify(lot)
|
return self.schema.jsonify(lot, nested=2)
|
||||||
|
|
||||||
@teal.cache.cache(datetime.timedelta(minutes=5))
|
@teal.cache.cache(datetime.timedelta(minutes=5))
|
||||||
def find(self, args: dict):
|
def find(self, args: dict):
|
||||||
|
@ -77,7 +77,7 @@ class LotView(View):
|
||||||
you can filter.
|
you can filter.
|
||||||
"""
|
"""
|
||||||
if args['format'] == LotFormat.UiTree:
|
if args['format'] == LotFormat.UiTree:
|
||||||
lots = self.schema.dump(Lot.query, many=True, nested=1)
|
lots = self.schema.dump(Lot.query, many=True, nested=2)
|
||||||
ret = {
|
ret = {
|
||||||
'items': {l['id']: l for l in lots},
|
'items': {l['id']: l for l in lots},
|
||||||
'tree': self.ui_tree(),
|
'tree': self.ui_tree(),
|
||||||
|
|
Reference in New Issue