Populate database from views

20 views
Skip to first unread message

Coulson Thabo Kgathi

unread,
Oct 25, 2012, 5:35:25 AM10/25/12
to django...@googlegroups.com
is it possible to do this?

i have data that i recieve into the view from my template and i want to save that data which is in an array in my view to a database

anybody help or link to where i can learn a way to do that

thanks a lot

Stephen Anto

unread,
Oct 25, 2012, 5:47:59 AM10/25/12
to django...@googlegroups.com
Hi,

if you have data in array list just use this

for list in array_list:
     modelObj = YourModel()
     modelObj.fieldname = list
     modelObj.save()

I believe it will help you... Thank you for visiting http://www.f2finterview.com/web/Django/


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/cXkin2Cr8XEJ.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.



--
Thanks & Regards
Stephen S



Blog:      blog.f2finterview.com

Coulson Thabo Kgathi

unread,
Oct 25, 2012, 5:55:32 AM10/25/12
to django...@googlegroups.com
thanks will try that
Reply all
Reply to author
Forward
0 new messages