I've seen some people create a form in the html template with names for the fields and then get the values of these fields by the name in the view when the request is post, so they don't create a forms.py file. Why did you create a forms.py file to set the names of your model fields if it's possible without it, or is you way better?? My second question is if I have a ManyToManyField in a model that inherits from another model which contains an ImageField to upload images to my db, I wanna make a custom form in html template where I can display all my images that are in the database and be able to select multiple images and when I submit the form I want the selected images to be stored as the values of the ManyToManyField I mentioned before, is such thing possible in Django?? I hope you answer me and thank you for making this video.
Handling forms in code is the Djangoish way of dealing with forms, and that's the convention which is considered as the de facto standard. And to your second question, that's absolutely possible in Django, in fact it seems to be not too hard to achieve. Thanks.
Thank you brother. You saved my life as a manual html snippets developer. Do you have any tutorial for saving and updating data from a custom form(Plain HTML Form) using django forms.
Glad to hear that brother❤️...Actually, I use Django forms all the time, except for some rare cases. Currently, there is no video in this channel where I deal with plain html forms. Anyway, its not that hard, you can find a lot of tutorials on the web😊
Hey man, thank you for the video but ı cant save the form into database by form.save(). What do ı have to do and Problem is form.save is not valid for forms.Form , it is for forms.ModelForm how can ı do it by ModelForm
For beginners just starting with Django, I would highly recommend using Function Based Views(FBVs) because it will actually makes us understand whats going around. Now, if we do have some experience, then stick with Class Based Views(CBVs) as they are highly efficient and wiill do the task just with few lines of code. This is one of my playlist in Django Class Based Views. So far, I have only done one video, but I will definitely update that in the future. ruclips.net/p/PLbasZIkCgHJFkmaNPyXqrOqFvZlWWlDmW Keep learning... :)
Sorry for being late...CBVs are secure as the implementation is already done and we have to just use it. This doesn't mean that FBVs are not secure...Its all up to you and how you design the logic.
You can use form.save() or use Model.objects.create(fields) where Model=your model name and fields are the fields in your model...(eg. Contact.objects.create(phone=323)) 😊
@@CodeBand buddy my requirements is I have to create 2 signup form for seller and customer in my project....and I wanted to use my table instead of "User" table because each customer has a foreign key which point his data and seller table also has a foreign key which point to it's multiple products
@@akshatchouhan5199 Using a new Authentication System by completely replacing the built-in one is not recommended unless the case is of extreme complexity. In your case, extending the built-in User model, along with adding multiple user types would do the trick in your case, I believe. You can refer this video for more info. : ruclips.net/video/f0hdXr2MOEA/видео.html
I've seen some people create a form in the html template with names for the fields and then get the values of these fields by the name in the view when the request is post, so they don't create a forms.py file. Why did you create a forms.py file to set the names of your model fields if it's possible without it, or is you way better??
My second question is if I have a ManyToManyField in a model that inherits from another model which contains an ImageField to upload images to my db, I wanna make a custom form in html template where I can display all my images that are in the database and be able to select multiple images and when I submit the form I want the selected images to be stored as the values of the ManyToManyField I mentioned before, is such thing possible in Django??
I hope you answer me and thank you for making this video.
Handling forms in code is the Djangoish way of dealing with forms, and that's the convention which is considered as the de facto standard.
And to your second question, that's absolutely possible in Django, in fact it seems to be not too hard to achieve.
Thanks.
@@CodeBand
Aha thanks for your reply, I'm just a beginner in Django that's why I don't know these things 😅
Hey no problem, happy to help, and its fairly easy to achieve.
Awesome stuff. Brilliant
Thanks a lot😊
I was just looking for such video for a long time..... For that case you got my sub :)
Thanks for the sub and very glad to hear that!
Keep going😊
Thank you brother. You saved my life as a manual html snippets developer. Do you have any tutorial for saving and updating data from a custom form(Plain HTML Form) using django forms.
Glad to hear that brother❤️...Actually, I use Django forms all the time, except for some rare cases. Currently, there is no video in this channel where I deal with plain html forms. Anyway, its not that hard, you can find a lot of tutorials on the web😊
Okay thank you brother, looking forward for more educational videos from you. Keep up the good work going 👍
@@venkatesh.jeyakumaresan Thanks a lot brother, will keep posting😊
@@CodeBand have you got the tutorial yet?
Hey man, thank you for the video but ı cant save the form into database by form.save(). What do ı have to do and Problem is form.save is not valid for forms.Form , it is for forms.ModelForm how can ı do it by ModelForm
Thanks for the video =)
My pleasure!
nice brother
Thanks😊
Hi brother. What is the difference between function base view and class base view? Which one is u prefer to use?
For beginners just starting with Django, I would highly recommend using Function Based Views(FBVs) because it will actually makes us understand whats going around. Now, if we do have some experience, then stick with Class Based Views(CBVs) as they are highly efficient and wiill do the task just with few lines of code.
This is one of my playlist in Django Class Based Views. So far, I have only done one video, but I will definitely update that in the future.
ruclips.net/p/PLbasZIkCgHJFkmaNPyXqrOqFvZlWWlDmW
Keep learning... :)
@@CodeBand that mean, class base view is secure?
Sorry for being late...CBVs are secure as the implementation is already done and we have to just use it. This doesn't mean that FBVs are not secure...Its all up to you and how you design the logic.
Awesome stuff keep doing. 😊
Subscribed.
Thank you so much 😁
Brilliant ❤️👌
Thanks a lot😊😊
thanks alot
Most welcome
THANK YOU !!!!
Keep going👍🏻
good
Thanks a lot😊
how can I assign those value in the database?
You can use form.save() or use Model.objects.create(fields) where Model=your model name and fields are the fields in your model...(eg. Contact.objects.create(phone=323))
😊
@@CodeBand yes .. I got it. thank you :)
@@tasniasharmin7701 Keep going :)
@@CodeBand I've tried using form.save but I'm not too sure if it's saving the data stored in my text boxes.
@@adnanmiah971 form.save() will save the object into the model...👍🏻
Can you provide a video for user define sign up form containing "password" & "email" field......there is very less videos of it
If you are looking for setting up a Custom User Model, then, here you go:
ruclips.net/video/SbU2wdPIcaY/видео.html
@@CodeBand buddy my requirements is I have to create 2 signup form for seller and customer in my project....and I wanted to use my table instead of "User" table because each customer has a foreign key which point his data and seller table also has a foreign key which point to it's multiple products
@@akshatchouhan5199 Using a new Authentication System by completely replacing the built-in one is not recommended unless the case is of extreme complexity. In your case, extending the built-in User model, along with adding multiple user types would do the trick in your case, I believe.
You can refer this video for more info. : ruclips.net/video/f0hdXr2MOEA/видео.html
hi, when I use the reverse_lazy() function it threw the 405 error
Guess not because of reverse_lazy() because 405 is Method Not Allowed... so an issue with GET / POST...