From 9e7278884536b2e62f80195f5b2cbbe895b487bf Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 3 Mar 2021 08:19:03 +0100 Subject: [PATCH] Update python.md Formatting --- docs/extend/python.md | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/docs/extend/python.md b/docs/extend/python.md index 6cca6b4..fa1849b 100644 --- a/docs/extend/python.md +++ b/docs/extend/python.md @@ -134,15 +134,34 @@ We can add manufacturers and suppliers to parts. If we add a manufacturer, a sup ```python from inventree.company import Company -acme = Company.create(api, { 'name' : 'ACME', 'description':'A Company that makes everything','website':'https://www.acme.bla','is_customer':0,'is_manufacturer':1,'is_supplier':0 }) -xstore = Company.create(api, { 'name' : 'X-Store', 'description':'A really cool online store','website':'https://www.xst.bla','is_customer':0,'is_manufacturer':0,'is_supplier':1 }) +acme = Company.create(api, { + 'name' : 'ACME', + 'description':'A Company that makes everything', + 'website':'https://www.acme.bla', + 'is_customer':0, + 'is_manufacturer':1, + 'is_supplier':0 +}) +xstore = Company.create(api, { + 'name' : 'X-Store', + 'description':'A really cool online store', + 'website':'https://www.xst.bla', + 'is_customer':0, + 'is_manufacturer':0, + 'is_supplier':1 +}) ``` Please recognize the different flag settings for is_supplier and is_manufacturer. Now lets add those to our couch: ```python from inventree.company import SupplierPart -SupplierPart.create(api,{'part':couch.pk,'supplier':xstore.pk,'SKU':'some_code','manufacturer':acme.pk}) +SupplierPart.create(api,{ + 'part':couch.pk, + 'supplier':xstore.pk, + 'SKU':'some_code', + 'manufacturer':acme.pk +}) ``` Supplier and manufacturer are added with just one command. The SKU is the code under which the couch is listed in the store. Her we can add price tags later on.