Unsure where to start

I have database experience, but not so much with Django. I have a project in mind, but am unsure how to begin, and could really use some guidance.

The project is setting up a CRUD app hosted on my desktop, and accessible from my phone. I have a hydroponic vegetable garden in my garage, and I want to log various activities for each plant for later analysis. When I go to see how one of my basil plants is doing, I want to input its ID (I would have an ID taped to the container), which pulls up the reference ranges for that plant species, allows me to input the initial fluid pH, and the final pH after I make adjustments, and autofill the datetime. And so on for as many other plants as I have going.

I think I should have three tables: 1) pH reference ranges for each plant species (e.g. speciesID ‘basil, italian’, high 5.5, low 6.5), 2) a key for each instance of a plant (e.g. instanceID 003, speciesID ‘basil, italian’, started 01/01/2023, ended 01/01/2024), and 3) activity logging (e.g. logID 060120231230, datetime 06/01/2023 12:30, instanceID 003, initialpH 7.0, finalpH 6.0, notes).

My biggest question is how do I set up the models to facilitate this kind of activity?

Welcome @MrTheFourth !

The Django models are a way of accessing your database tables.

You would design your database the same way as for any other application. The only current constraints you really need to be aware of are:

  • Every table must have a primary key
  • No current support for composite primary keys

Design your database the way you would according to whatever principles you use. (If it’s third-normal form, fine. If you adhere to other practices, that’s fine too.)

Then create your models to match those tables.

Your project sounds interesting - perfect use of Django, and that’s cool you’re hosting it locally.

It you’re interested in getting booted-up on the project (Python / Django / deployment), I’m happy to code jam with you, and help get you to a good spot. It can be fun coding with a social/team vibe rather than solo mission - especially when starting out!

Let me know! Might be others interested in helping out too!