Where to put cattle data related to horn type and if registered

Currently experimenting with importing data from the spreadsheet I currently use to record my cattle inventory. I expect that some things will not match up one-to-one, and will come up with workarounds.

With that said, I have the following two columns in my spreadsheet:
Horns (options are Polled, Scurred, Horned, Blank)
Registration Number (if a particular animal is registered with a Canadian Cattle Breeder Association, the registration number is recorded)

When it’s getting close to doing fall dehorning, I can sort the spreadsheet by Horns to determine how many need to be done.

Similarly, if I want to know how many of the animals in my current herd are registered, I can sort on the Registration Number column.

Is there a recommended way to handle this data within FarmOS 2.x? Or does this become a development project?

2 Likes

Are you self hosted or on Farmier?

It would be a very simple module to add those extra fields, they could also be worthy of a PR to core farmOS.

On Pedigree registration numbers there is currently the facility for multiple tag numbers, so EID, EAR, legband, other etc. Other could be used as a workaround for the moment.

1 Like

Agree with @Farmer-Ed - ideally you could use the existing ID Tag field that’s available on all assets for your registration numbers. However, there isn’t currently a way to sort by those IDs in the built-in farmOS UIs (we should add that!). If you are self-hosting and familiar with Views it would be pretty easy to whip up a custom View with a sortable column, though.

As for “Horns”, that might make sense as a new field provided by a custom module. This page describes how to do that: Fields | farmOS

It would be great to think of a general solution to that one too, without needing a custom module. It reminds me of some earlier brainstorming we did around tracking of different arbitrary “states” or “traits” of assets over time. The current “Castrated” field on Animal assets is a similar case.

1 Like

Installed Docker on a Synology NAS, then pulled the FarmOS 2.2.2 container into it, so, yes, currently self hosting. Made some recommended changes (persistent file folder, SMTP, FarmOS Asset Link) as well as loading practically every available module. PostgresSQL running in a separate docker container.

1 Like

My concern with developing custom modules is what happens when FarmOS 2.2.3 or later comes out. The second I start customizing the software I figure I lose the ability to upgrade to newer versions of the software, well, without spending hours going over development notes to see if any of “your” changes will clash with mine.

I’ve already had a incident where my farmOS container simply vanished from my system, necessitating recreating it from scratch. Not sure I want to add numerous customizations, lose the container for some reason, then have to re-create everything.

1 Like

You’re right @armitagep: you should never touch the farmOS code itself! But with custom modules you don’t have to! You put them in specific directories of your webroot alongside the farmOS code.

If you are using Docker already, you are probably already mounting a volume to persist the /opt/drupal/web/sites directory outside of the Docker container (to preserve things like sites/default/settings.php and uploaded files), as described here: Installing farmOS | farmOS

The easiest thing to do is make a sites/all/modules directory, and inside that you can build your own custom modules, as described here: farmOS module development | farmOS

WARNING: NEVER do module development on your live site/database. You can pretty easily get yourself into a broken state that is very hard to get out of. Always set up a development environment and test it there first. See: Getting started | farmOS

There are other options too. What I described above is an easy way to start experimenting, but ultimately the best way to manage custom code and your farmOS deployment configuration together is something like this: Building farmOS with Composer | farmOS

That’s on the advanced side, though, and you might not need that level of control.

Hope that helps! Feel free to start a new forum thread if you have questions about setting up your environment.

1 Like