naturerobots / HSOS-SEP-PlantMap-2022

PlantMap Digital Logbook: A tool to support sustainable micro farming :link: https://naturerobots.github.io/HSOS-SEP-PlantMap-2022/
BSD 3-Clause "New" or "Revised" License
4 stars 5 forks source link

Integrate plants endpoint #131

Closed dobro929 closed 2 years ago

dobro929 commented 2 years ago

wait until #130 is finished to integrate companies//gardens//beds//plants wait until #171

dobro929 commented 2 years ago

@Anafabula @jarkenau Since #171 is done, is there already a user where I can query the data? The test user does not work for querying the data.

jarkenau commented 2 years ago

Currently, there is no default data in the database, so you have to create a company and garden manually, but we are working on that in #186 and #172 (should be done by Thursday).

jarkenau commented 2 years ago

I updated the dev Branch, after a fresh installation of the Dev-Container the following steps to should get the default data running. Further automatization is planned in #190

  1. cd django
  2. python3 manage.py makemigrations
  3. python3 manage.py migrate
  4. python3 manage.py loaddata user company garden bed
  5. celery -A restapi.tasks worker --loglevel=info
  6. python3 manage.py runserver (in a new terminal)
dobro929 commented 2 years ago

Thanks for the detailed answer, loading the demo data works πŸ‘πŸΌ

dobro929 commented 2 years ago

@jarkenau @Anafabula I just noticed that soil_humidty is not spelled correctly. There is an missing i. Can we correct that? And if possible can we rename bedid into bed_id πŸ™πŸΌπŸ˜„

And another thing at the endpoint ../beds the array is missing, we get only bed objects strung together. Please change it to be the same as ../plants.

{
   "beds":[]
}
jarkenau commented 2 years ago

@dobro929 I included the suggestions for the keys.

Also in the startup process you now need to use: python3 manage.py loaddata user company garden bed permissions

dobro929 commented 2 years ago

@jarkenau this does not seem to be working πŸ€”

grafik

jarkenau commented 2 years ago

@pbrozi deleted some migrations due to some errors which were hard to fix. You probably need to empty the database. I just used docker system prune -a --volumes to uninstall all docker volumes and images from the pc and then reopen the development container to get a fresh installation. This of course only applies if you're using the latest changes from the dev Branch.

lsiebels commented 2 years ago

I updated the dev Branch, after a fresh installation of the Dev-Container the following steps to should get the default data running. Further automatization is planned in #190

  1. cd django
  2. python3 manage.py makemigrations
  3. python3 manage.py migrate
  4. python3 manage.py loaddata user company garden bed
  5. celery -A restapi.tasks worker --loglevel=info
  6. python3 manage.py runserver (in a new terminal)

@jarkenau Regardless of #190 please document this.