Compare commits

...

9 Commits

Author SHA1 Message Date
Wir
e3cc967a71 neues Datenmodell5 hochgeladen 2024-11-25 19:10:03 +01:00
Wir
fca3def892 Reporting in Excel 2024-11-20 15:13:46 +01:00
32c9bf4e66 erklaerung liste 2024-11-19 15:29:18 +01:00
Wir
f73edd7692 Reporting Daten verfügbar 2024-11-14 19:19:42 +01:00
0bb91c25b7 added get_inventory_logs_of_type() to Asset 2024-11-14 18:01:01 +01:00
Wir
6c1e9f63f2 blabal 2024-11-12 17:58:37 +01:00
a2fbb6bf20 log notes 2024-11-12 17:37:05 +01:00
f350685e00 ammend 2024-11-12 17:28:21 +01:00
ff27f922b8 make multiple taxonomy items clear in name 2024-11-12 17:27:35 +01:00
7 changed files with 2422 additions and 579 deletions

BIN
Datenmodell5.xlsx Normal file

Binary file not shown.

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 62 KiB

View File

@@ -23,7 +23,7 @@ def init_api():
client_secret = client_secret client_secret = client_secret
) )
break break
except ConnectionError: except:
print("Fehler bei Verbindung mit Server (wahrscheinlich DuckDns) probiere erneut...") print("Fehler bei Verbindung mit Server (wahrscheinlich DuckDns) probiere erneut...")
oauth = OAuth2(client_id=client_id, client=client, token=token) oauth = OAuth2(client_id=client_id, client=client, token=token)

View File

@@ -23,6 +23,19 @@ class Asset(jsonapi_requests.orm.ApiModel):
break; break;
return related return related
def get_inventory_logs_of_type(self, type):
if not issubclass(type, Log.Log):
raise ValueError("type specified is not a type of log use for example: get_logs_of_type(Log.Harvest)")
logs = type.get_list()
related = []
for log in logs:
for quantity in log.quantities:
if quantity.inventory_asset:
if quantity.inventory_asset.id == self.id:
related.append(log)
break;
return related
class Land(Asset): class Land(Asset):
class Meta(Asset.Meta): class Meta(Asset.Meta):
name = 'land' name = 'land'
@@ -33,8 +46,8 @@ class Plant(Asset):
class Meta(Asset.Meta): class Meta(Asset.Meta):
name = 'plant' name = 'plant'
type, path = Asset.Meta.get_type_and_path(name) type, path = Asset.Meta.get_type_and_path(name)
crop = jsonapi_requests.orm.RelationField('plant_type') crops = jsonapi_requests.orm.RelationField('plant_type')
season = jsonapi_requests.orm.RelationField('season') seasons = jsonapi_requests.orm.RelationField('season')
class Equipment(Asset): class Equipment(Asset):
class Meta(Asset.Meta): class Meta(Asset.Meta):
name = 'equipment' name = 'equipment'

View File

@@ -12,6 +12,11 @@ class Log(jsonapi_requests.orm.ApiModel):
location = jsonapi_requests.orm.RelationField('location') location = jsonapi_requests.orm.RelationField('location')
equipment = jsonapi_requests.orm.RelationField('equipment') equipment = jsonapi_requests.orm.RelationField('equipment')
quantities = jsonapi_requests.orm.RelationField('quantity') quantities = jsonapi_requests.orm.RelationField('quantity')
json_notes = jsonapi_requests.orm.AttributeField('notes')
@property
def notes(self):
return self.json_notes['value']
@property @property
def plant(self): def plant(self):

File diff suppressed because it is too large Load Diff

12
test.py
View File

@@ -1,5 +1,7 @@
import neofarm.lib as neo liste = [1, 2, 3]
m = 1
if __name__ == "__main__": print(liste[m])
log = neo.Log.Purchase.get_list()[1] for element in liste:
print(log.quantities[1].material_types[0].name) print(element)
for i in range(len(liste)):
print(liste[i])