Compare commits
9 Commits
5c45389af3
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e3cc967a71 | ||
|
|
fca3def892 | ||
| 32c9bf4e66 | |||
|
|
f73edd7692 | ||
| 0bb91c25b7 | |||
|
|
6c1e9f63f2 | ||
| a2fbb6bf20 | |||
| f350685e00 | |||
| ff27f922b8 |
BIN
Datenmodell5.xlsx
Normal file
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 |
@@ -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)
|
||||||
|
|||||||
@@ -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'
|
||||||
|
|||||||
@@ -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):
|
||||||
|
|||||||
2103
reporting.ipynb
2103
reporting.ipynb
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user