From af26664164e2312dc490edbcc657723fff01329b Mon Sep 17 00:00:00 2001 From: Oliver Date: Tue, 7 Mar 2023 22:50:09 +1100 Subject: [PATCH] Update example for validation mixin plugin (#450) --- docs/extend/plugins/validation.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/extend/plugins/validation.md b/docs/extend/plugins/validation.md index 549491a..18fb381 100644 --- a/docs/extend/plugins/validation.md +++ b/docs/extend/plugins/validation.md @@ -47,8 +47,13 @@ Custom serial number validation can be implemented using the `validate_serial_nu A plugin which requires all serial numbers to be valid hexadecimal values may implement this method as follows: ```python -def validate_serial_number(self, serial: str): - """Validate the supplied serial number""" +def validate_serial_number(self, serial: str, part: Part): + """Validate the supplied serial number + + Arguments: + serial: The proposed serial number (string) + part: The Part instance for which this serial number is being validated + """ try: # Attempt integer conversion