IRC logs for #farmOS, 2019-11-13 (GMT)

2019-11-12
2019-11-14
TimeNickMessage
[19:13:19]* FijiDave has joined #farmos
[19:14:44]* FijiDave_ has quit (Ping timeout: 276 seconds)
[20:57:49]<paul121[m]>> Also, for paul121 the API instructions for FarmOS.py are not 100% correct - get all animals is farm.asset.get({'type':'animal'}) not farm.log.get
[20:57:49]<paul121[m]>skipper_is Thanks for noting that! Just merged your PR.
[21:22:54]<paul121[m]>skipper_is: You mentioned something about looping through logs & results in farmOS - this should work just fine! check out this gist.
[21:22:54]<paul121[m]>https://gist.github.com/paul121/011a5d56df1693b7f4a0dd353af9d4b0
[21:31:34]<paul121[m]>Right now results are buried in the `'list'` key of what is returned... which is maybe not a very "pythonic" way to do it? But I think we're open to input on that
[21:33:02]<paul121[m]>Also, you mentioned creating models for `areas`, `assets`, and `logs` - I love this idea!
[21:34:27]<paul121[m]>I think it would make to sense to even just "supply" those with the farmOS.py library. They could be supplied under `farm.models.log`
[21:34:49]<paul121[m]>So you could do `from farm.models import log, area, asset`
[21:36:05]<paul121[m]>and in some way say `log = log(name="My log name", type="farm_observation")`
[21:38:28]<paul121[m]>The `pydantic` library is something i've been using in the farmOS aggregator - it adds some support for Typing in Python. Makes things a bit handier. Also allows you to inherit objects from one another. So we could have a base `log` object, and then inherit those properties to a `observation_log` type that has additional fields... etc
[21:40:45]<paul121[m]>ACTION sent a long message: < >
[02:11:23]* FijiDave has quit (Ping timeout: 276 seconds)
[03:19:42]* JustTB has quit (Quit: Leaving.)
[03:27:58]* JustTB has joined #farmos
[06:49:20]* JustTB has quit (Ping timeout: 252 seconds)
[07:05:05]* JustTB has joined #farmos
[07:46:21]<mstenta[m]>Hey all
[07:46:28]<mstenta[m]>I won't be able to host the monthly call today
[07:46:42]<mstenta[m]>My son is home sick from school
[07:48:05]<mstenta[m]>Feel free to chat here! I'll try to check if there are folks with questions
[07:50:19]* JustTB has quit (Ping timeout: 268 seconds)
[08:05:59]* JustTB has joined #farmos
[09:25:32]<mstenta[m]>skipper_is: I haven't had a chance to play around with the Postgres migration yet :-/
[09:26:22]<mstenta[m]>I was wondering though: if I were able to fix the older issue you found, would that allow you to stay on postgres instead of migrate?
[09:26:39]<mstenta[m]>Because I do want to fix that anyway - so maybe it makes more sense for me to focus on that
[10:50:05]* JustTB has quit (Ping timeout: 276 seconds)
[11:28:04]* JustTB has joined #farmos
[11:40:16]<mstenta[m]>Hey skipper_is - side question: can you test out the new map drawing measurements stuff I'm working on? demo here: https://mstenta.github.io/farmOS-map/
[11:40:32]<mstenta[m]>See if you can break it
[11:40:34]<mstenta[m]>:-)
[11:45:51]* JustTB has quit (Read error: No route to host)
[11:46:29]<skipper_is[m]>Yea, if everything was stable, i'd stay on Postgres, it is my main DB for GIS, so it seems daft to be running two DBs
[11:46:53]<skipper_is[m]>Ooh, some funky weirdness with times..
[11:47:44]<mstenta[m]>Ok, what is your timeline for deploying it on your farm? Maybe I can try to get the postgres bug fixed before then... you're waiting for approval right?
[11:48:40]<skipper_is[m]>Well, we're deployed on my server, but it is located in france, so from data protection/privacy point of view, I'd like to keep it inhouse, so I'm waiting for IT to give me a server
[11:48:47]<skipper_is[m]>The principle of the college is onboard, so I think approval is ok, it is just getting IT to make it happen
[11:49:09]<mstenta[m]>ok
[11:50:10]<skipper_is[m]>It is mainly just that there is the occasional bug which stops everything from working, stops the field kit from syncing, throws weird errors etc.
[11:50:34]<mstenta[m]>yea... and i think we traced most things to that one issue
[11:50:49]<skipper_is[m]>And if I am wanting to showcase it for our farm, and maybe roll it out to the other college farms, I want it to be quite stable - hence why I was going to run it on MySQL
[11:50:49]<mstenta[m]>which i understand pretty well... just requires some focus time to fix
[11:51:18]<skipper_is[m]>Yea, I know, and because it is OS, I don't want to push for a fix, as it is all done through your free time
[11:52:28]<mstenta[m]>Yea, but it's good motivation - I do want farmOS to officially support PostgreSQL. It does for the most part. It's just that one clever custom query.
[11:52:29]<mstenta[m]>(Clever custom queries are never a good idea) ;-)
[11:52:32]<skipper_is[m]>ACTION sent a long message: < >
[11:52:59]<skipper_is[m]>At the minute it is just an init
[11:52:59]<mstenta[m]>> Ooh, some funky weirdness with times..
[11:52:59]<mstenta[m]>What are you referring to here?
[11:53:47]<skipper_is[m]>Ah my Riot.im is showing the testing of farmBOT as happening after the chats today
[11:53:54]<skipper_is[m]>When that happened yesterday
[11:55:20]<skipper_is[m]>Just creating a function to parse the json to a log object, but it is rather messy..
[11:55:29]<skipper_is[m]>I'm not happy with the implementation
[11:56:26]<jgaehring[m]>> I had a go at a class for logs
[11:56:26]<jgaehring[m]>oh funny, this looks like the makeLog factory we're using in Field Kit: https://github.com/farmOS/farmOS-client/blob/master/src/utils/makeLog.js...
[11:56:33]* bkumpula[m] has joined #farmos
[11:57:34]<skipper_is[m]>Oooo JS..... .....
[12:01:10]<jgaehring[m]>hahaha
[12:01:20]<jgaehring[m]>didn't say it was pretty
[12:01:45]<jgaehring[m]>but! it makes things a lot easier elsewhere, hides a lot of ugliness
[12:01:46]<skipper_is[m]>I haven't got around to learning JS :P
[12:02:02]<skipper_is[m]>Like klingon to me..
[12:04:13]* JustTB has joined #farmos
[12:04:36]<skipper_is[m]>There is no switch/case for Python?!
[12:11:39]* FijiDave has joined #farmos
[12:14:51]<skipper_is[m]>ACTION sent a long message: < >
[13:22:39]* germarsh[m] has joined #farmos
[14:18:41]<skipper_is[m]>mstenta: The new map works really nicely
[14:18:43]<skipper_is[m]>Snapping is great!
[14:29:29]<skipper_is[m]>I've finally patched the restws file.. Will try again with the fieldkit
[14:35:58]<skipper_is[m]>It is still not syncing..
[14:36:13]<skipper_is[m]>Oh
[14:36:14]<skipper_is[m]>`Failed to load resource: the server responded with a status of 403 (Forbidden)`
[14:47:58]<skipper_is[m]>I am assuming field kit relogs if the cookie expires..
[14:51:32]<jgaehring[m]>right now it does not login again automatically if the token expires... hoping to smoothe out that process when we migrate to OAuth
[14:52:04]<skipper_is[m]>How long to tokens last?
[14:59:55]<jgaehring[m]>oh trying to remember...
[15:01:33]<jgaehring[m]>I believe it's about a week?
[15:11:00]<skipper_is[m]>So, I have to log out and back in again every week?
[15:21:44]<jgaehring[m]>you won't have to log out, but you'll be prompted to log back in when you try to sync after about a week