fix: fix 'arguments-differ' for pylint
This commit is contained in:
parent
8008b0edad
commit
e0a58dc524
8 changed files with 78 additions and 41 deletions
|
@ -4,5 +4,3 @@
|
|||
disable=fixme,
|
||||
duplicate-code,
|
||||
abstract-method,
|
||||
arguments-differ,
|
||||
arguments-renamed,
|
||||
|
|
|
@ -1030,7 +1030,7 @@ class NewOrderBatchHandler(BatchHandler): # pylint: disable=too-many-public-met
|
|||
|
||||
super().remove_row(row)
|
||||
|
||||
def do_delete(self, batch, user, **kwargs):
|
||||
def do_delete(self, batch, user, **kwargs): # pylint: disable=arguments-differ
|
||||
"""
|
||||
Delete a batch completely.
|
||||
|
||||
|
@ -1054,7 +1054,7 @@ class NewOrderBatchHandler(BatchHandler): # pylint: disable=too-many-public-met
|
|||
# continue with normal deletion
|
||||
super().do_delete(batch, user, **kwargs)
|
||||
|
||||
def why_not_execute(self, batch, **kwargs):
|
||||
def why_not_execute(self, batch, **kwargs): # pylint: disable=arguments-differ
|
||||
"""
|
||||
By default this checks to ensure the batch has a customer with
|
||||
phone number, and at least one item. It also may check to
|
||||
|
|
|
@ -46,8 +46,9 @@ class OrderRef(ObjectRef):
|
|||
""" """
|
||||
return query.order_by(self.model_class.order_id)
|
||||
|
||||
def get_object_url(self, order): # pylint: disable=empty-docstring
|
||||
def get_object_url(self, obj): # pylint: disable=empty-docstring
|
||||
""" """
|
||||
order = obj
|
||||
return self.request.route_url("orders.view", uuid=order.uuid)
|
||||
|
||||
|
||||
|
@ -71,8 +72,9 @@ class LocalCustomerRef(ObjectRef):
|
|||
""" """
|
||||
return query.order_by(self.model_class.full_name)
|
||||
|
||||
def get_object_url(self, customer): # pylint: disable=empty-docstring
|
||||
def get_object_url(self, obj): # pylint: disable=empty-docstring
|
||||
""" """
|
||||
customer = obj
|
||||
return self.request.route_url("local_customers.view", uuid=customer.uuid)
|
||||
|
||||
|
||||
|
@ -96,8 +98,9 @@ class PendingCustomerRef(ObjectRef):
|
|||
""" """
|
||||
return query.order_by(self.model_class.full_name)
|
||||
|
||||
def get_object_url(self, customer): # pylint: disable=empty-docstring
|
||||
def get_object_url(self, obj): # pylint: disable=empty-docstring
|
||||
""" """
|
||||
customer = obj
|
||||
return self.request.route_url("pending_customers.view", uuid=customer.uuid)
|
||||
|
||||
|
||||
|
@ -120,8 +123,9 @@ class LocalProductRef(ObjectRef):
|
|||
""" """
|
||||
return query.order_by(self.model_class.scancode)
|
||||
|
||||
def get_object_url(self, product): # pylint: disable=empty-docstring
|
||||
def get_object_url(self, obj): # pylint: disable=empty-docstring
|
||||
""" """
|
||||
product = obj
|
||||
return self.request.route_url("local_products.view", uuid=product.uuid)
|
||||
|
||||
|
||||
|
@ -145,6 +149,7 @@ class PendingProductRef(ObjectRef):
|
|||
""" """
|
||||
return query.order_by(self.model_class.scancode)
|
||||
|
||||
def get_object_url(self, product): # pylint: disable=empty-docstring
|
||||
def get_object_url(self, obj): # pylint: disable=empty-docstring
|
||||
""" """
|
||||
product = obj
|
||||
return self.request.route_url("pending_products.view", uuid=product.uuid)
|
||||
|
|
|
@ -136,8 +136,9 @@ class NewOrderBatchView(BatchMasterView):
|
|||
# TODO: call self.app.get_batch_handler()
|
||||
return NewOrderBatchHandler(self.config)
|
||||
|
||||
def configure_grid(self, g): # pylint: disable=empty-docstring
|
||||
def configure_grid(self, grid): # pylint: disable=empty-docstring
|
||||
""" """
|
||||
g = grid
|
||||
super().configure_grid(g)
|
||||
|
||||
# store_id
|
||||
|
@ -147,8 +148,9 @@ class NewOrderBatchView(BatchMasterView):
|
|||
# total_price
|
||||
g.set_renderer("total_price", "currency")
|
||||
|
||||
def configure_form(self, f): # pylint: disable=empty-docstring
|
||||
def configure_form(self, form): # pylint: disable=empty-docstring
|
||||
""" """
|
||||
f = form
|
||||
super().configure_form(f)
|
||||
|
||||
# store_id
|
||||
|
@ -164,8 +166,9 @@ class NewOrderBatchView(BatchMasterView):
|
|||
# total_price
|
||||
f.set_node("total_price", WuttaMoney(self.request))
|
||||
|
||||
def configure_row_grid(self, g): # pylint: disable=empty-docstring
|
||||
def configure_row_grid(self, grid): # pylint: disable=empty-docstring
|
||||
""" """
|
||||
g = grid
|
||||
super().configure_row_grid(g)
|
||||
|
||||
# TODO
|
||||
|
@ -187,12 +190,13 @@ class NewOrderBatchView(BatchMasterView):
|
|||
# total_price
|
||||
g.set_renderer("total_price", "currency")
|
||||
|
||||
def get_xref_buttons(self, batch):
|
||||
def get_xref_buttons(self, obj):
|
||||
"""
|
||||
Adds "View this Order" button, if batch has been executed and
|
||||
a corresponding :class:`~sideshow.db.model.orders.Order` can
|
||||
be located.
|
||||
"""
|
||||
batch = obj
|
||||
buttons = super().get_xref_buttons(batch)
|
||||
model = self.app.model
|
||||
session = self.Session()
|
||||
|
|
|
@ -76,8 +76,9 @@ class LocalCustomerView(MasterView):
|
|||
"new_order_batches",
|
||||
]
|
||||
|
||||
def configure_grid(self, g): # pylint: disable=empty-docstring
|
||||
def configure_grid(self, grid): # pylint: disable=empty-docstring
|
||||
""" """
|
||||
g = grid
|
||||
super().configure_grid(g)
|
||||
|
||||
# links
|
||||
|
@ -87,8 +88,9 @@ class LocalCustomerView(MasterView):
|
|||
g.set_link("phone_number")
|
||||
g.set_link("email_address")
|
||||
|
||||
def configure_form(self, f): # pylint: disable=empty-docstring
|
||||
def configure_form(self, form): # pylint: disable=empty-docstring
|
||||
""" """
|
||||
f = form
|
||||
super().configure_form(f)
|
||||
customer = f.model_instance
|
||||
|
||||
|
@ -247,8 +249,9 @@ class PendingCustomerView(MasterView):
|
|||
"new_order_batches",
|
||||
]
|
||||
|
||||
def configure_grid(self, g): # pylint: disable=empty-docstring
|
||||
def configure_grid(self, grid): # pylint: disable=empty-docstring
|
||||
""" """
|
||||
g = grid
|
||||
super().configure_grid(g)
|
||||
enum = self.app.enum
|
||||
|
||||
|
@ -262,8 +265,9 @@ class PendingCustomerView(MasterView):
|
|||
g.set_link("phone_number")
|
||||
g.set_link("email_address")
|
||||
|
||||
def configure_form(self, f): # pylint: disable=empty-docstring
|
||||
def configure_form(self, form): # pylint: disable=empty-docstring
|
||||
""" """
|
||||
f = form
|
||||
super().configure_form(f)
|
||||
enum = self.app.enum
|
||||
customer = f.model_instance
|
||||
|
@ -387,8 +391,9 @@ class PendingCustomerView(MasterView):
|
|||
|
||||
return customer
|
||||
|
||||
def delete_instance(self, customer): # pylint: disable=empty-docstring
|
||||
def delete_instance(self, obj): # pylint: disable=empty-docstring
|
||||
""" """
|
||||
customer = obj
|
||||
model_title = self.get_model_title()
|
||||
|
||||
# avoid deleting if still referenced by order(s)
|
||||
|
|
|
@ -165,8 +165,9 @@ class OrderView(MasterView): # pylint: disable=too-many-public-methods
|
|||
self.order_handler = self.app.get_order_handler()
|
||||
self.batch_handler = self.app.get_batch_handler("neworder")
|
||||
|
||||
def configure_grid(self, g): # pylint: disable=empty-docstring
|
||||
def configure_grid(self, grid): # pylint: disable=empty-docstring
|
||||
""" """
|
||||
g = grid
|
||||
super().configure_grid(g)
|
||||
|
||||
# store_id
|
||||
|
@ -952,12 +953,14 @@ class OrderView(MasterView): # pylint: disable=too-many-public-methods
|
|||
|
||||
return data
|
||||
|
||||
def get_instance_title(self, order): # pylint: disable=empty-docstring
|
||||
def get_instance_title(self, instance): # pylint: disable=empty-docstring
|
||||
""" """
|
||||
order = instance
|
||||
return f"#{order.order_id} for {order.customer_name}"
|
||||
|
||||
def configure_form(self, f): # pylint: disable=empty-docstring
|
||||
def configure_form(self, form): # pylint: disable=empty-docstring
|
||||
""" """
|
||||
f = form
|
||||
super().configure_form(f)
|
||||
order = f.model_instance
|
||||
|
||||
|
@ -984,8 +987,9 @@ class OrderView(MasterView): # pylint: disable=too-many-public-methods
|
|||
f.set_node("created_by", UserRef(self.request))
|
||||
f.set_readonly("created_by")
|
||||
|
||||
def get_xref_buttons(self, order): # pylint: disable=empty-docstring
|
||||
def get_xref_buttons(self, obj): # pylint: disable=empty-docstring
|
||||
""" """
|
||||
order = obj
|
||||
buttons = super().get_xref_buttons(order)
|
||||
model = self.app.model
|
||||
session = self.Session()
|
||||
|
@ -1006,14 +1010,16 @@ class OrderView(MasterView): # pylint: disable=too-many-public-methods
|
|||
|
||||
return buttons
|
||||
|
||||
def get_row_grid_data(self, order): # pylint: disable=empty-docstring
|
||||
def get_row_grid_data(self, obj): # pylint: disable=empty-docstring
|
||||
""" """
|
||||
order = obj
|
||||
model = self.app.model
|
||||
session = self.Session()
|
||||
return session.query(model.OrderItem).filter(model.OrderItem.order == order)
|
||||
|
||||
def configure_row_grid(self, g): # pylint: disable=empty-docstring
|
||||
def configure_row_grid(self, grid): # pylint: disable=empty-docstring
|
||||
""" """
|
||||
g = grid
|
||||
super().configure_row_grid(g)
|
||||
# enum = self.app.enum
|
||||
|
||||
|
@ -1066,8 +1072,9 @@ class OrderView(MasterView): # pylint: disable=too-many-public-methods
|
|||
enum = self.app.enum
|
||||
return enum.ORDER_ITEM_STATUS[value]
|
||||
|
||||
def get_row_action_url_view(self, item, i): # pylint: disable=empty-docstring
|
||||
def get_row_action_url_view(self, row, i): # pylint: disable=empty-docstring
|
||||
""" """
|
||||
item = row
|
||||
return self.request.route_url("order_items.view", uuid=item.uuid)
|
||||
|
||||
def configure_get_simple_settings(self): # pylint: disable=empty-docstring
|
||||
|
@ -1115,7 +1122,9 @@ class OrderView(MasterView): # pylint: disable=too-many-public-methods
|
|||
|
||||
return settings
|
||||
|
||||
def configure_get_context(self, **kwargs): # pylint: disable=empty-docstring
|
||||
def configure_get_context( # pylint: disable=empty-docstring,arguments-differ
|
||||
self, **kwargs
|
||||
):
|
||||
""" """
|
||||
context = super().configure_get_context(**kwargs)
|
||||
|
||||
|
@ -1154,7 +1163,9 @@ class OrderView(MasterView): # pylint: disable=too-many-public-methods
|
|||
|
||||
return settings
|
||||
|
||||
def configure_remove_settings(self, **kwargs): # pylint: disable=empty-docstring
|
||||
def configure_remove_settings( # pylint: disable=empty-docstring,arguments-differ
|
||||
self, **kwargs
|
||||
):
|
||||
""" """
|
||||
model = self.app.model
|
||||
session = self.Session()
|
||||
|
@ -1347,8 +1358,9 @@ class OrderItemView(MasterView):
|
|||
model = self.app.model
|
||||
return query.join(model.Order)
|
||||
|
||||
def configure_grid(self, g): # pylint: disable=empty-docstring
|
||||
def configure_grid(self, grid): # pylint: disable=empty-docstring
|
||||
""" """
|
||||
g = grid
|
||||
super().configure_grid(g)
|
||||
model = self.app.model
|
||||
# enum = self.app.enum
|
||||
|
@ -1420,8 +1432,9 @@ class OrderItemView(MasterView):
|
|||
return f"has-background-{variant}"
|
||||
return None
|
||||
|
||||
def configure_form(self, f): # pylint: disable=empty-docstring
|
||||
def configure_form(self, form): # pylint: disable=empty-docstring
|
||||
""" """
|
||||
f = form
|
||||
super().configure_form(f)
|
||||
enum = self.app.enum
|
||||
item = f.model_instance
|
||||
|
@ -1532,8 +1545,9 @@ class OrderItemView(MasterView):
|
|||
)
|
||||
return value
|
||||
|
||||
def get_xref_buttons(self, item): # pylint: disable=empty-docstring
|
||||
def get_xref_buttons(self, obj): # pylint: disable=empty-docstring
|
||||
""" """
|
||||
item = obj
|
||||
buttons = super().get_xref_buttons(item)
|
||||
|
||||
if self.request.has_perm("orders.view"):
|
||||
|
@ -1765,8 +1779,9 @@ class PlacementView(OrderItemView):
|
|||
enum = self.app.enum
|
||||
return query.filter(model.OrderItem.status_code == enum.ORDER_ITEM_STATUS_READY)
|
||||
|
||||
def configure_grid(self, g): # pylint: disable=empty-docstring
|
||||
def configure_grid(self, grid): # pylint: disable=empty-docstring
|
||||
""" """
|
||||
g = grid
|
||||
super().configure_grid(g)
|
||||
|
||||
# checkable
|
||||
|
@ -1905,8 +1920,9 @@ class ReceivingView(OrderItemView):
|
|||
model.OrderItem.status_code == enum.ORDER_ITEM_STATUS_PLACED
|
||||
)
|
||||
|
||||
def configure_grid(self, g): # pylint: disable=empty-docstring
|
||||
def configure_grid(self, grid): # pylint: disable=empty-docstring
|
||||
""" """
|
||||
g = grid
|
||||
super().configure_grid(g)
|
||||
|
||||
# checkable
|
||||
|
@ -2088,8 +2104,9 @@ class ContactView(OrderItemView):
|
|||
)
|
||||
)
|
||||
|
||||
def configure_grid(self, g): # pylint: disable=empty-docstring
|
||||
def configure_grid(self, grid): # pylint: disable=empty-docstring
|
||||
""" """
|
||||
g = grid
|
||||
super().configure_grid(g)
|
||||
|
||||
# checkable
|
||||
|
@ -2255,8 +2272,9 @@ class DeliveryView(OrderItemView):
|
|||
)
|
||||
)
|
||||
|
||||
def configure_grid(self, g): # pylint: disable=empty-docstring
|
||||
def configure_grid(self, grid): # pylint: disable=empty-docstring
|
||||
""" """
|
||||
g = grid
|
||||
super().configure_grid(g)
|
||||
|
||||
# checkable
|
||||
|
|
|
@ -88,8 +88,9 @@ class LocalProductView(MasterView):
|
|||
"new_order_batches",
|
||||
]
|
||||
|
||||
def configure_grid(self, g): # pylint: disable=empty-docstring
|
||||
def configure_grid(self, grid): # pylint: disable=empty-docstring
|
||||
""" """
|
||||
g = grid
|
||||
super().configure_grid(g)
|
||||
|
||||
# unit_cost
|
||||
|
@ -105,8 +106,9 @@ class LocalProductView(MasterView):
|
|||
g.set_link("description")
|
||||
g.set_link("size")
|
||||
|
||||
def configure_form(self, f): # pylint: disable=empty-docstring
|
||||
def configure_form(self, form): # pylint: disable=empty-docstring
|
||||
""" """
|
||||
f = form
|
||||
super().configure_form(f)
|
||||
product = f.model_instance
|
||||
|
||||
|
@ -293,8 +295,9 @@ class PendingProductView(MasterView):
|
|||
"new_order_batches",
|
||||
]
|
||||
|
||||
def configure_grid(self, g): # pylint: disable=empty-docstring
|
||||
def configure_grid(self, grid): # pylint: disable=empty-docstring
|
||||
""" """
|
||||
g = grid
|
||||
super().configure_grid(g)
|
||||
enum = self.app.enum
|
||||
|
||||
|
@ -323,8 +326,9 @@ class PendingProductView(MasterView):
|
|||
return "has-background-warning"
|
||||
return None
|
||||
|
||||
def configure_form(self, f): # pylint: disable=empty-docstring
|
||||
def configure_form(self, form): # pylint: disable=empty-docstring
|
||||
""" """
|
||||
f = form
|
||||
super().configure_form(f)
|
||||
product = f.model_instance
|
||||
|
||||
|
@ -457,8 +461,9 @@ class PendingProductView(MasterView):
|
|||
|
||||
return context
|
||||
|
||||
def delete_instance(self, product): # pylint: disable=empty-docstring
|
||||
def delete_instance(self, obj): # pylint: disable=empty-docstring
|
||||
""" """
|
||||
product = obj
|
||||
|
||||
# avoid deleting if still referenced by new order batch(es)
|
||||
for row in product.new_order_batch_rows:
|
||||
|
|
|
@ -56,8 +56,9 @@ class StoreView(MasterView):
|
|||
|
||||
sort_defaults = "store_id"
|
||||
|
||||
def configure_grid(self, g): # pylint: disable=empty-docstring
|
||||
def configure_grid(self, grid): # pylint: disable=empty-docstring
|
||||
""" """
|
||||
g = grid
|
||||
super().configure_grid(g)
|
||||
|
||||
# links
|
||||
|
@ -72,8 +73,9 @@ class StoreView(MasterView):
|
|||
return "has-background-warning"
|
||||
return None
|
||||
|
||||
def configure_form(self, f): # pylint: disable=empty-docstring
|
||||
def configure_form(self, form): # pylint: disable=empty-docstring
|
||||
""" """
|
||||
f = form
|
||||
super().configure_form(f)
|
||||
|
||||
# store_id
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue