brew_journal/recipies/serializers.py
def create(self, validated_data):
        """Create the recipe and all related data"""
        # As hops and malt will be handled separately, remove them from the current data.
        hops  = validated_data.pop("recipe_hops")
        malts = validated_data.pop('recipe_malts')
        user  = validated_data.pop('user')

        return Recipe.objects.create_recipe(user, validated_data, malts, hops)
Create the recipe and all related data
Create the recipe and all related data
Create the recipe and all related data
def create(self, validated_data):
        hops  = validated_data.pop("recipe_hops")
        malts = validated_data.pop('recipe_malts')
        user  = validated_data.pop('user')
        return Recipe.objects.create_recipe(user, validated_data, malts, hops)
def create ( self , validated_data ) : hops = validated_data . pop ( "recipe_hops" ) malts = validated_data . pop ( 'recipe_malts' ) user = validated_data . pop ( 'user' ) return Recipe . objects . create_recipe ( user , validated_data , malts , hops )
Create the recipe and all related data
Create the recipe and all related data
"""Create the recipe and all related data""" # As hops and malt will be handled separately, remove them from the current data.

self
validated_data