diff --git a/neofarm/klassendiagramm/classes_neofarm.svg b/neofarm/klassendiagramm/classes_neofarm.svg index 8c3e44a..2faea4b 100644 --- a/neofarm/klassendiagramm/classes_neofarm.svg +++ b/neofarm/klassendiagramm/classes_neofarm.svg @@ -4,11 +4,11 @@ - + classes_neofarm - + log.Activity @@ -188,32 +188,33 @@ quantity.Material - -Material - - - + +Material + +material_types : RelationField + + quantity.Quantity - -Quantity - -inventory_adjustment : AttributeField -inventory_asset : RelationField -json_value : AttributeField -measure : AttributeField -units : RelationField -value - - + +Quantity + +inventory_adjustment : AttributeField +inventory_asset : RelationField +json_value : AttributeField +measure : AttributeField +units : RelationField +value + + quantity.Material->quantity.Quantity - - + + @@ -248,484 +249,484 @@ asset.Asset.Meta - -Meta - -type : str - - + +Meta + +type : str + + asset.Land.Meta - -Meta - -name : str -path -type - - + +Meta + +name : str +path +type + + asset.Land.Meta->asset.Asset.Meta - - + + asset.Plant.Meta - -Meta - -name : str -path -type - - + +Meta + +name : str +path +type + + asset.Plant.Meta->asset.Asset.Meta - - + + asset.Equipment.Meta - -Meta - -name : str -path -type - - + +Meta + +name : str +path +type + + asset.Equipment.Meta->asset.Asset.Meta - - + + asset.Material.Meta - -Meta - -name : str -path -type - - + +Meta + +name : str +path +type + + asset.Material.Meta->asset.Asset.Meta - - + + asset.Seed.Meta - -Meta - -name : str -path -type - - + +Meta + +name : str +path +type + + asset.Seed.Meta->asset.Asset.Meta - - + + asset.Product.Meta - -Meta - -name : str -path -type - - + +Meta + +name : str +path +type + + asset.Product.Meta->asset.Asset.Meta - - + + log.Log.Meta - -Meta - -type : str - - + +Meta + +type : str + + log.Activity.Meta - -Meta - -name : str -path -type - - + +Meta + +name : str +path +type + + log.Activity.Meta->log.Log.Meta - - + + log.Maintenance.Meta - -Meta - -name : str -path -type - - + +Meta + +name : str +path +type + + log.Maintenance.Meta->log.Log.Meta - - + + log.Purchase.Meta - -Meta - -name : str -path -type - - + +Meta + +name : str +path +type + + log.Purchase.Meta->log.Log.Meta - - + + log.Seeding.Meta - -Meta - -name : str -path -type - - + +Meta + +name : str +path +type + + log.Seeding.Meta->log.Log.Meta - - + + log.Input.Meta - -Meta - -name : str -path -type - - + +Meta + +name : str +path +type + + log.Input.Meta->log.Log.Meta - - + + log.Medical.Meta - -Meta - -name : str -path -type - - + +Meta + +name : str +path +type + + log.Medical.Meta->log.Log.Meta - - + + log.Harvest.Meta - -Meta - -name : str -path -type - - + +Meta + +name : str +path +type + + log.Harvest.Meta->log.Log.Meta - - + + log.Sale.Meta - -Meta - -name : str -path -type - - + +Meta + +name : str +path +type + + log.Sale.Meta->log.Log.Meta - - + + quantity.Quantity.Meta - -Meta - -type : str - - + +Meta + +type : str + + quantity.Standard.Meta - -Meta - -name : str -path -type - - + +Meta + +name : str +path +type + + quantity.Standard.Meta->quantity.Quantity.Meta - - + + quantity.Price.Meta - -Meta - -name : str -path -type - - + +Meta + +name : str +path +type + + quantity.Price.Meta->quantity.Quantity.Meta - - + + quantity.Material.Meta - -Meta - -name : str -path -type - - + +Meta + +name : str +path +type + + quantity.Material.Meta->quantity.Quantity.Meta - - + + taxonomy.Taxonomy.Meta - -Meta - -type : str - - + +Meta + +type : str + + taxonomy.Crop.Meta - -Meta - -name : str -path -type - - + +Meta + +name : str +path +type + + taxonomy.Crop.Meta->taxonomy.Taxonomy.Meta - - + + taxonomy.LogCategory.Meta - -Meta - -name : str -path -type - - + +Meta + +name : str +path +type + + taxonomy.LogCategory.Meta->taxonomy.Taxonomy.Meta - - + + taxonomy.MaterialType.Meta - -Meta - -name : str -path -type - - + +Meta + +name : str +path +type + + taxonomy.MaterialType.Meta->taxonomy.Taxonomy.Meta - - + + taxonomy.PlantType.Meta - -Meta - -name : str -path -type - - + +Meta + +name : str +path +type + + taxonomy.PlantType.Meta->taxonomy.Taxonomy.Meta - - + + taxonomy.ProductType.Meta - -Meta - -name : str -path -type - - + +Meta + +name : str +path +type + + taxonomy.ProductType.Meta->taxonomy.Taxonomy.Meta - - + + taxonomy.Season.Meta - -Meta - -name : str -path -type - - + +Meta + +name : str +path +type + + taxonomy.Season.Meta->taxonomy.Taxonomy.Meta - - + + taxonomy.Unit.Meta - -Meta - -name : str -path -type - - + +Meta + +name : str +path +type + + taxonomy.Unit.Meta->taxonomy.Taxonomy.Meta - - + + my_meta.MyMeta - -MyMeta - - -get_type_and_path(name) -set_api(api) + +MyMeta + + +get_type_and_path(name) +set_api(api) @@ -762,21 +763,21 @@ quantity.Price - -Price - -json_total_price : AttributeField -json_unit_price : AttributeField -total_price -unit_price - - + +Price + +json_total_price : AttributeField +json_unit_price : AttributeField +total_price +unit_price + + quantity.Price->quantity.Quantity - - + + @@ -889,17 +890,17 @@ quantity.Standard - -Standard - - - + +Standard + + + quantity.Standard->quantity.Quantity - - + + diff --git a/neofarm/orm/quantity.py b/neofarm/orm/quantity.py index b7656fb..9fd01fa 100644 --- a/neofarm/orm/quantity.py +++ b/neofarm/orm/quantity.py @@ -37,4 +37,5 @@ class Price(Quantity): class Material(Quantity): class Meta(Quantity.Meta): name = 'material' - type, path = Quantity.Meta.get_type_and_path(name) \ No newline at end of file + type, path = Quantity.Meta.get_type_and_path(name) + material_types = jsonapi_requests.orm.RelationField('material_type') \ No newline at end of file diff --git a/test.py b/test.py index 99ac199..7ee4559 100644 --- a/test.py +++ b/test.py @@ -1,5 +1,5 @@ import neofarm.lib as neo if __name__ == "__main__": - log = neo.Log.Purchase.from_id("6ecc063f-3995-45e6-872e-952b811eaa94") - print(log.quantities[0].total_price) \ No newline at end of file + log = neo.Log.Purchase.get_list()[1] + print(log.quantities[1].material_types[0].name) \ No newline at end of file