These are chat archives for django/django

2nd
Jan 2016
Kaushal Kumar
@kaushal087
Jan 02 2016 10:19
I have form in html page. It's not django's form. That page contains many checkbox. On clicking submit button. I want to save all the ids of checkboxes to database. How can I fetch data from request.POST?
I am newbie in django. I have used .Net and php for wen development.
kristian koci
@kkoci
Jan 02 2016 16:25
It should be possible @kaushal087
Kaushal Kumar
@kaushal087
Jan 02 2016 16:33
Thank you @kkoci . It's done.
kristian koci
@kkoci
Jan 02 2016 16:34
Awesome :D
Kaushal Kumar
@kaushal087
Jan 02 2016 16:34
I have one other issue
Kaushal Kumar
@kaushal087
Jan 02 2016 16:42
I have one animal table. I have to insert ,update and delete , and show the animal based on I'd. I can show animal details by going to id BASE_URL/show/1. It shows animal details having I'd 1. Now I am updating animal details by going to URL BASE_URL/edit/1. After update it redirects to BASE_URL/show/1. But I also want to display that animal details has been updated.
I have to use post method . on submit It is redirected to BASE_URL/update/1. After updating data in database or redirects to BASE_URL/show/1
How can I do this
rishu-18
@rishu-18
Jan 02 2016 17:36
how can i use django 'User' models fieilds in my app
??
user = User.objects.all() print user.username , user.first_name
its not working
Kaushal Kumar
@kaushal087
Jan 02 2016 18:11
For userrow in user: print userrow.username, userrow.firstname
@rishu-18
rishu-18
@rishu-18
Jan 02 2016 19:22
@kaushal087 but to authenticate any user in my app if i am using password then how i will match with the password in django user models .. beccause that is hashed using alogrithm + salting
and thanks it works
that userrow.username
Kaushal Kumar
@kaushal087
Jan 02 2016 19:25
I don't know much about authentication in django yet. if you just want to know how you will match Those passwords you can generated hash of the given password with hashed password saved in db. It is used in every language or framework. Not only in django.
@rishu-18
rishu-18
@rishu-18
Jan 02 2016 19:30
thanks
Pēteris Caune
@cuu508
Jan 02 2016 20:44
@kaushal087: on alerting user about updated animal – check out messages framework: https://docs.djangoproject.com/en/1.9/ref/contrib/messages/
rishu-18
@rishu-18
Jan 02 2016 21:52
how i can authenticate my app in which password i am matching with admin's user model password