James,

I was able to get thro with the save operation. It was quite a bit of 
learning.

Meta section on the model existed but I was not populating validated_data 
properly. I was under the assumption that 

when I did

serializer=UserPrefSerializer(data=request.data)

seriazer object will be populated with post request data.

I had to resort to

             address_obj=Stock.objects.get(symbol=request.data['address'])

             user_obj=User.objects.get(username=request.user)

            serializer.validated_data['stock_id']=address_obj.id

            serializer.validated_data['user_id']=user_obj.id

I am not sure if this is the optimal way to do it but this seem to have 
done the trick.

Heartfelt thanks for handholding me through this.

- Shekar

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/452653a5-6bcc-4e48-9bd8-8d9aea866ecc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to