django_recipes icon indicating copy to clipboard operation
django_recipes copied to clipboard

Initial Fixtures and version info

Open iarp opened this issue 4 years ago • 5 comments

In case anyone comes across this repo in 2021 and is not using mysql, attached to this issue is a fixture dump. Update database settings accordingly and python manage.py loaddata recipes_data.json. You'll have to rename the file txt to json as github doesn't allow json upload.

recipes_dump.txt

If you're not using pipenv, the Pint version matters more than the rest. Something changed within Pint and when these two lines execute the calculation is off by a tiny bit. It causes units to get messed up and what should be "2 cups" displays as "1 1/1 cup". I just pinned to 0.7.2 and its working just fine.

iarp avatar Feb 07 '21 00:02 iarp

Thanks @iarp, feel free to submit any PR if you want.

I'm still alive. Just added 2 recipes to my site today! https://recipes.davidgrant.ca/

I actually have some new features I'd like to add soon. I have a new job which should hopefully allow me more time to work on this than my last job did.

dgrant avatar Feb 07 '21 03:02 dgrant

I'm very much in the beginning stage of figuring out how things work and really wanting to figure out why some conversions are bad. I get that 1Tbsp == 3Tsp but I would think if I put 1Tbsp on the items row it would display 1Tbsp. However somewhere my 1Tbsp gets converted into 0.0625 cups which then converts back to 3Tsp and then I'm lost in logic today.

iarp avatar Feb 07 '21 03:02 iarp

Any reason you weren't able to use pipenv? Because yeah that pint version is important, I remember running into those issues years ago and pinning it and never got a chance to figure it out.

dgrant avatar Feb 10 '21 02:02 dgrant

How did you create the dump?

dgrant avatar Feb 10 '21 02:02 dgrant

I have mysql running for one last wordpress project that i'm converting. Everything else is on postgres these days. So i just made the database, migrated to mysql and then restored the sql file supplied in the repo.

As for the dump, django has a system for dumping and loading fixtures: https://docs.djangoproject.com/en/3.1/ref/django-admin/#dumpdata

iarp avatar Feb 10 '21 18:02 iarp