diff --git a/neofarm/klassendiagramm/classes_neofarm.svg b/neofarm/klassendiagramm/classes_neofarm.svg index 54c8f63..8cb8395 100644 --- a/neofarm/klassendiagramm/classes_neofarm.svg +++ b/neofarm/klassendiagramm/classes_neofarm.svg @@ -4,11 +4,11 @@ - - + + classes_neofarm - + log.Activity @@ -21,14 +21,16 @@ log.Log - -Log - -assets : RelationField -equipment : RelationField -isMovement : AttributeField -location : RelationField -name : AttributeField + +Log + +assets : RelationField +equipment : RelationField +isMovement : AttributeField +json_notes : AttributeField +location : RelationField +name : AttributeField +notes plant quantities : RelationField timestamp : AttributeField @@ -38,20 +40,20 @@ log.Activity->log.Log - - + + asset.Asset - -Asset - -location : RelationField -name : AttributeField -timestamp : AttributeField - -get_logs_of_type(type) + +Asset + +location : RelationField +name : AttributeField +timestamp : AttributeField + +get_logs_of_type(type) @@ -65,18 +67,18 @@ taxonomy.Taxonomy - -Taxonomy - -name : AttributeField - - + +Taxonomy + +name : AttributeField + + taxonomy.Crop->taxonomy.Taxonomy - - + + @@ -90,8 +92,8 @@ asset.Equipment->asset.Asset - - + + @@ -105,8 +107,8 @@ log.Harvest->log.Log - - + + @@ -120,8 +122,8 @@ log.Input->log.Log - - + + @@ -136,8 +138,8 @@ asset.Land->asset.Asset - - + + @@ -151,8 +153,8 @@ taxonomy.LogCategory->taxonomy.Taxonomy - - + + @@ -166,8 +168,8 @@ log.Maintenance->log.Log - - + + @@ -182,8 +184,8 @@ asset.Material->asset.Asset - - + + @@ -198,23 +200,23 @@ 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 - - + + @@ -228,8 +230,8 @@ taxonomy.MaterialType->taxonomy.Taxonomy - - + + @@ -243,18 +245,18 @@ log.Medical->log.Log - - + + asset.Asset.Meta - -Meta - -type : str - - + +Meta + +type : str + + @@ -271,8 +273,8 @@ asset.Land.Meta->asset.Asset.Meta - - + + @@ -289,8 +291,8 @@ asset.Plant.Meta->asset.Asset.Meta - - + + @@ -307,8 +309,8 @@ asset.Equipment.Meta->asset.Asset.Meta - - + + @@ -325,8 +327,8 @@ asset.Material.Meta->asset.Asset.Meta - - + + @@ -343,8 +345,8 @@ asset.Seed.Meta->asset.Asset.Meta - - + + @@ -361,18 +363,18 @@ asset.Product.Meta->asset.Asset.Meta - - + + log.Log.Meta - -Meta - -type : str - - + +Meta + +type : str + + @@ -389,8 +391,8 @@ log.Activity.Meta->log.Log.Meta - - + + @@ -407,8 +409,8 @@ log.Maintenance.Meta->log.Log.Meta - - + + @@ -425,8 +427,8 @@ log.Purchase.Meta->log.Log.Meta - - + + @@ -443,8 +445,8 @@ log.Seeding.Meta->log.Log.Meta - - + + @@ -461,8 +463,8 @@ log.Input.Meta->log.Log.Meta - - + + @@ -479,8 +481,8 @@ log.Medical.Meta->log.Log.Meta - - + + @@ -497,8 +499,8 @@ log.Harvest.Meta->log.Log.Meta - - + + @@ -515,18 +517,18 @@ log.Sale.Meta->log.Log.Meta - - + + quantity.Quantity.Meta - -Meta - -type : str - - + +Meta + +type : str + + @@ -543,8 +545,8 @@ quantity.Standard.Meta->quantity.Quantity.Meta - - + + @@ -561,8 +563,8 @@ quantity.Price.Meta->quantity.Quantity.Meta - - + + @@ -579,18 +581,18 @@ quantity.Material.Meta->quantity.Quantity.Meta - - + + taxonomy.Taxonomy.Meta - -Meta - -type : str - - + +Meta + +type : str + + @@ -607,8 +609,8 @@ taxonomy.Crop.Meta->taxonomy.Taxonomy.Meta - - + + @@ -625,8 +627,8 @@ taxonomy.LogCategory.Meta->taxonomy.Taxonomy.Meta - - + + @@ -643,8 +645,8 @@ taxonomy.MaterialType.Meta->taxonomy.Taxonomy.Meta - - + + @@ -661,8 +663,8 @@ taxonomy.PlantType.Meta->taxonomy.Taxonomy.Meta - - + + @@ -679,8 +681,8 @@ taxonomy.ProductType.Meta->taxonomy.Taxonomy.Meta - - + + @@ -697,8 +699,8 @@ taxonomy.Season.Meta->taxonomy.Taxonomy.Meta - - + + @@ -715,8 +717,8 @@ taxonomy.Unit.Meta->taxonomy.Taxonomy.Meta - - + + @@ -742,8 +744,8 @@ asset.Plant->asset.Asset - - + + @@ -757,8 +759,8 @@ taxonomy.PlantType->taxonomy.Taxonomy - - + + @@ -776,8 +778,8 @@ quantity.Price->quantity.Quantity - - + + @@ -792,8 +794,8 @@ asset.Product->asset.Asset - - + + @@ -807,8 +809,8 @@ taxonomy.ProductType->taxonomy.Taxonomy - - + + @@ -822,8 +824,8 @@ log.Purchase->log.Log - - + + @@ -837,8 +839,8 @@ log.Sale->log.Log - - + + @@ -852,8 +854,8 @@ taxonomy.Season->taxonomy.Taxonomy - - + + @@ -869,8 +871,8 @@ asset.Seed->asset.Asset - - + + @@ -884,8 +886,8 @@ log.Seeding->log.Log - - + + @@ -899,8 +901,8 @@ quantity.Standard->quantity.Quantity - - + + @@ -914,8 +916,8 @@ taxonomy.Unit->taxonomy.Taxonomy - - + + diff --git a/neofarm/orm/log.py b/neofarm/orm/log.py index 5001403..f5a4edc 100644 --- a/neofarm/orm/log.py +++ b/neofarm/orm/log.py @@ -12,6 +12,11 @@ class Log(jsonapi_requests.orm.ApiModel): location = jsonapi_requests.orm.RelationField('location') equipment = jsonapi_requests.orm.RelationField('equipment') quantities = jsonapi_requests.orm.RelationField('quantity') + json_notes = jsonapi_requests.orm.AttributeField('notes') + + @property + def notes(self): + return self.json_notes['value'] @property def plant(self): diff --git a/test.py b/test.py index 7ee4559..acd5e82 100644 --- a/test.py +++ b/test.py @@ -1,5 +1,5 @@ import neofarm.lib as neo if __name__ == "__main__": - log = neo.Log.Purchase.get_list()[1] - print(log.quantities[1].material_types[0].name) \ No newline at end of file + log = neo.Log.Seeding.get_list()[1] + print(log.notes) \ No newline at end of file