-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Ingredient model does not have a related_name for the user field.
Recipe model does not provide a related name that correctly represents that relationship.
Remember, related names are used for the reverse relationships, i.e. for the model being referenced in the Foreign Key Field. Meaning, that on line 24 of recipes.models, it should be recipes instead of categories; so that the reverse query for a category instance can easily get all the recipes it has a relation with and make sense.
Currently, to access all the recipes under a category would look like this:
category = Category.get(id=1)
related_recipes_for_category = category.categories.all()
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request