Hi,
When you save your data, you can say .save(force_insert).
Django usually makes decision based on primary key value, if it's None
Django tries to insert, otherwise Django tries update and then insert if
update fails.
On 14.10.2016 10:50, Frank Semaganga wrote:
Hello Team,
I am having challenge with my views/dB.
I am receiving http data and successfully save to the models but the
problem is sometimes the data get into new dB row and sometimes is
updating the existing dB row.
I want it to insert new row every time data is received.
What could have been a problem!! any experience!!
--
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
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com
<mailto:django-users@googlegroups.com>.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/1560dd92-5263-4985-84cc-e0fccc46bcd1%40googlegroups.com
<https://groups.google.com/d/msgid/django-users/1560dd92-5263-4985-84cc-e0fccc46bcd1%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
--
Jani Tiainen
--
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/da62a6e1-46d6-4222-4f6b-f2172b11f3d3%40gmail.com.
For more options, visit https://groups.google.com/d/optout.