def create_product (self, name, location='GLO', unit='kg', **kwargs):

        """
        Create a new product in the model database
        """

        new_product = item_factory(name=name, location=location, unit=unit, type='product', **kwargs)

        if not self.exists_in_database(new_product['code']):
            self.add_to_database(new_product)
            #print ('{} added to database'.format(name))
            return self.get_exchange(name)
        else:
            #print('{} already exists in this database'.format(name))
            return False
def create_product ( self , name , location = 'GLO' , unit = 'kg' , ** kwargs ) : new_product = item_factory ( name = name , location = location , unit = unit , type = 'product' , ** kwargs ) if not self . exists_in_database ( new_product [ 'code' ] ) : self . add_to_database ( new_product ) return self . get_exchange ( name ) else : return False
Create a new product in the model database