Closed MichaelWashburnJr closed 7 years ago
Yep, let me know if you're still working on this - been out of town for a while
Sure. I'll have a PR ready in the next day or so. I let this slide to the back burner for a few days.
The Fermentable.json()
method doesn't function as intended.
Is the goal just to return a string that's valid JSON with the given keys/values? If so I'll re-write the method and send it in the same PR.
I'm also running into errors related to the 'type' attribute. This attribute shadows the name of a built-in function, and it's messing up Django's internals. Is it OK to refactor and change the name to fermentable_type ?
@JayWelborn I think the fermentable.json()
function might not be in use anymore. I believe all the resources use the fermentable serializer to translate it into json now. Try deleting it and see if you get errors. Regarding the type
attribute, I'm fine refactoring it to be fermentable_type
.
I noticed that you used type
on all of your models, so if you aren't getting any errors from it it might not be worth the effort of renaming every reference to every model's type
attribute.
If you're using a linter, you would probably see a redefinition warning, depending on your configuration. It doesn't actually break anything, and is totally allowed in Python. I'm OK with it as-is because in reality it's not even redefining type
, since it's within a Class. But I would also understand if someone wanted to change it to something else. So I guess my final say is "take it or leave it"
Can I take a crack at this one, too?