Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

django change foreign key

b = Blog.objects.get(pk=1)
Entry.objects.filter(pk=17).update(blog=b)

#1)Need to select row/rows which you wanna update
#2) Use function update
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #django #change #foreign #key
ADD COMMENT
Topic
Name
8+7 =