Expose version history for all supported tables
mostly for sake of products, but various..
This commit is contained in:
parent
5be3671a77
commit
bea28e97e9
14 changed files with 31 additions and 6 deletions
|
@ -77,6 +77,7 @@ class ProductsView(MasterView):
|
|||
"""
|
||||
model_class = model.Product
|
||||
supports_mobile = True
|
||||
has_versions = True
|
||||
|
||||
grid_columns = [
|
||||
'upc',
|
||||
|
@ -89,12 +90,6 @@ class ProductsView(MasterView):
|
|||
'current_price',
|
||||
]
|
||||
|
||||
# child_version_classes = [
|
||||
# (model.ProductCode, 'product_uuid'),
|
||||
# (model.ProductCost, 'product_uuid'),
|
||||
# (model.ProductPrice, 'product_uuid'),
|
||||
# ]
|
||||
|
||||
# These aliases enable the grid queries to filter products which may be
|
||||
# purchased from *any* vendor, and yet sort by only the "preferred" vendor
|
||||
# (since that's what shows up in the grid column).
|
||||
|
@ -366,6 +361,13 @@ class ProductsView(MasterView):
|
|||
'instance_title': self.get_instance_title(instance),
|
||||
'form': form})
|
||||
|
||||
def get_version_child_classes(self):
|
||||
return [
|
||||
(model.ProductCode, 'product_uuid'),
|
||||
(model.ProductCost, 'product_uuid'),
|
||||
(model.ProductPrice, 'product_uuid'),
|
||||
]
|
||||
|
||||
def image(self):
|
||||
"""
|
||||
View which renders the product's image as a response.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue