No video

Inline Formsets | Django (3.0) Crash Course Tutorials (pt 11)

  Рет қаралды 137,953

Dennis Ivy

Dennis Ivy

Күн бұрын

Check out my Complete Django course! dub.sh/NvGboTI
Saving objects with parent instance and advancing with django formsets.
Follow me on Twitter: / dennisivy11
Linkedin: / dennis-ivanov
Source code + Live Demo: dennis-sourcec...

Пікірлер: 230
@DennisIvy
@DennisIvy Ай бұрын
Don't forget to check out my Complete Django course! dub.sh/NvGboTI
@caiopjv
@caiopjv 5 ай бұрын
Thank you so much! 3 years later, this video helped me so much! I spent days on chatgpt and couldn't learn what I've learned here. I hope you don't stop posting
@rishupal7952
@rishupal7952 4 жыл бұрын
And in chandler's voice...COULD IT BE ANYMORE PERFECT!
@mohamedmamoun1870
@mohamedmamoun1870 3 жыл бұрын
@Azizbek Xushnazarov man you have to watch friends she cant explain the joke
@maciejcelinski4496
@maciejcelinski4496 4 жыл бұрын
If You like me forget to update 'updateOrder' view. You can do this in "order_form.html' .. in input place this code: {% csrf_token %} {% if form %} {{form}} {% endif %} {% if formset %} {{ formset.management_form }} {% for form in formset %} {{ form }} {% endfor %} {% endif%}
@airinakter2003
@airinakter2003 3 жыл бұрын
It works for me. Thank you so much.
@nhfx2261
@nhfx2261 8 ай бұрын
thanks learned new things
@umar-toirov
@umar-toirov Ай бұрын
This course the best I have even even seen though after 4 years
@miguelng02
@miguelng02 4 жыл бұрын
Thanks! A good improvement would be trying to create one order with multiple items, since with this model, you have to generate multiple order if you have more than one item.
@DennisIvy
@DennisIvy 4 жыл бұрын
Good idea :)
@euriperez9586
@euriperez9586 4 жыл бұрын
@@DennisIvy Agreed with this guy, could be awesome to create one order with multiple items, thank you so much for this series.
@youssefelotmani4206
@youssefelotmani4206 3 жыл бұрын
@@DennisIvy it s just reminder if possible and thanks a lot for your effort ! it s really a golden tuto
@abenitesema1516
@abenitesema1516 4 жыл бұрын
i'm a high school student and this is the coolest tutorial if this fits to me this means any one can learn a lot from this tutorial , thank you dennis !!!!
@sidekick3rida
@sidekick3rida 3 жыл бұрын
Adding formsets breaks updating orders (/update_order//)
@soyadmohifulislam4323
@soyadmohifulislam4323 3 жыл бұрын
if someone has the error: " 'set' object has no attribute 'append' " then you should change the 'fields' data type set to tuple. I mean you should use normal brackets not curly braces. OrderFormSet = inlineformset_factory(Customer,Order,fields={'product','status'}) New: OrderFormSet = inlineformset_factory(Customer,Order,fields=('product','status'))
@johnnyli2732
@johnnyli2732 4 жыл бұрын
Hi Dennis, Great Tutorials! Having one question on this inline formsets. How can I have an 'add' button to control the amount of forms I want dynamically? Tried with jquery, but the data was submitted to database instead of creating an extra form on the page..
@shankarbalaji1916
@shankarbalaji1916 2 жыл бұрын
use button tag with type="button" for add button
@letscodemore
@letscodemore 2 жыл бұрын
You can follow this article to add “Add More” button. www.letscodemore.com/blog/django-inline-formset-factory-with-examples/
@prajithkrish5230
@prajithkrish5230 4 жыл бұрын
Hey regarding the inline form sets ... is there a way to implement features such as adding fields and deleting fields individually, I searched the whole django world for this and literally your the closest one I can get
@rayr268
@rayr268 4 жыл бұрын
Search dynamic django forms. There are some articles online now.
@davidbrown2806
@davidbrown2806 4 жыл бұрын
1. Why is there a "delete box" in the Order Form ??????? Do we need it ? Do we get rid of it ? 2. It would have been nice to see the other method, that does not use the loop. 3. I wonder if you could use the inline form feature to create a kit or package of individual parts that someone could buy, enter the package SKU and the form expands the package into individual orders. ie BBQ package .... includes BBQ grill, propane tank, and cooking utensils. Love to see it.
@Alliswelltoday
@Alliswelltoday 4 жыл бұрын
Dennies please make vedios on DJANGO REST APIS
@numanxaziz
@numanxaziz 3 жыл бұрын
Hey Dennis.. When i try to pass urlspatterens =[ path('create_order/'/, views.createOrder, name= ' create_order')] dynamically, it throws an error [reverse match not found and stuff like that]. Everthing is good i checked every url even templates but nothing helps. But without the dynamic url and customer initials, it works fine. Plz help
@wassimharakeh8699
@wassimharakeh8699 4 жыл бұрын
I was trying to message you but i had no idea where to reach you from, so i will just type my message right here, in this legendary django series i was following recently. I followed you step by step and currently i'm in part 11..it's the coolest tutorial i have ever watched, CAN'T DESCRIBE HOW HAPPY I AM while learning from your super skills!! It's literally the first time where i feel comfortable building a project while understanding every single step😍😍 It's been like 2 months since i subscribed to your channel, and i thank god i did. I just have one question to ask.. In almost every django tutorial, in the first steps of the project where we work with cmd and creating our directory, the instructor creates a virtual environment before django-admin startproject .... While in this series, we are building our project without any virtualenv created Why? 🤔🤔 I'm literally enjoying every minute building this CRM website and only have this question and again, THANK YOU. 🙏🙏🙏
@lehuythinh6754
@lehuythinh6754 3 жыл бұрын
About the virtualenv, it is for isolate the running system django is using. If you dont have the need of isolating it, then venv has no use.
@psrajoria
@psrajoria 3 жыл бұрын
Hey Dennis! Thanks for this amazing content. If possible, could you please make a video on how to create a popup for deleting or updating anything in Django?
@chennai-media7920
@chennai-media7920 3 жыл бұрын
Do u got any tutorial for that so far, if yes ,share it with me please.
@JKahlonMusic
@JKahlonMusic 4 жыл бұрын
Absolutely amazing content man. keep it up.
@DennisIvy
@DennisIvy 4 жыл бұрын
Thank you thank you thank you!! I appreciate the support so much!
@khadimhusen
@khadimhusen 4 жыл бұрын
Any tutoria for django on dropdown box with typing options. Because when there are more than 100 items in dropdown it is difficult to find and select.
@kimhongsieng6457
@kimhongsieng6457 4 жыл бұрын
It is nice for you inline formset video. if we have new customer and we want to make an order during add new customer, what should we do?
@sumanthsure4761
@sumanthsure4761 4 жыл бұрын
I am not able to get multiple formset after changing the code what might be the reason. Didn't get a delete checkbox also as shown in the video 6:48. Not able to loop also
@adamhughes5527
@adamhughes5527 4 жыл бұрын
These are really great and covered a bunch of things my knowledge was a bit vague on! :D
@anindyasikdar3221
@anindyasikdar3221 4 жыл бұрын
I'm confused with when to use instance and when to use initial. Are they interchangeable? Any help will be appreciated. Thanks!
@LIMLIMLIM111
@LIMLIMLIM111 3 жыл бұрын
instance refers to one of the objects in a model. Initial pre-fills form's fields. Using the Instance argument does pre-fill the form, but it's an "extra feature", not the main functionality.
@LIMLIMLIM111
@LIMLIMLIM111 3 жыл бұрын
"No, there's quite a difference. "Initial" is used to set the initial values and is quite appropriate when a *new* model instance is going to be created. The "instance" is used when you want the ModelForm to be used to update an existing instance of a model. Since Django does not currently incorporate mind-reading technology, if the two parameters were merged into one, the framework wouldn't know whether it's meant to be updating an existing instance or creating a new one." from: groups.google.com/g/django-users/c/wi6yOo3N0FU
@franklinguang
@franklinguang 4 жыл бұрын
Hi Dennis, thanks for this selfless effort. It really help. I got to a stage where I got stuck with one page handling multiple forms. One to update exiting instance, one to add new entry data. Could you make a video address how these can be done?
@fadyghalayiny1920
@fadyghalayiny1920 4 жыл бұрын
Hi can you show us an example if I want to include current logged in user without showing it in the form
@talhaamir9023
@talhaamir9023 3 жыл бұрын
Never Learned Django better than this !!!
@stevenlee1726
@stevenlee1726 3 жыл бұрын
Next traversy media? Road to 1 million subscriber bro. Thank you so much for the tutorial. Really really appreciate it
@airinakter2003
@airinakter2003 3 жыл бұрын
getting error 9.01 NoReverseMatch at / Reverse for 'create_order' with no arguments not found. 1 pattern(s) tried: ['create_order/(?P[^/]+)/$']
@rishupal7952
@rishupal7952 4 жыл бұрын
This had really helped soo much!!! We all are thankful to u.. much love from india
@malikdiallo9976
@malikdiallo9976 4 жыл бұрын
Hi Dennis. Using the URL "path ('create_order / /', views.createOrder, name =" create_order "),", I can no longer display the dashboard. What could I miss? Here is the message that appears : django.urls.exceptions.NoReverseMatch: Reverse for 'customers' not found. 'customers' is not a valid view function or pattern name. Thank you in advance for this series of tutorials.
@DennisIvy
@DennisIvy 4 жыл бұрын
Can you please send a screenshot or you views.py file to dennisivy11@gmail.com? I’ll take a look when I have a second
@chinmaydali3083
@chinmaydali3083 4 жыл бұрын
@@DennisIvy Even I am having this issue, will you please share the solution.
@chinmaydali3083
@chinmaydali3083 4 жыл бұрын
I am also having the same problem, if you have got the solution would you care to share it please.
@julianbazanaguirre8439
@julianbazanaguirre8439 4 жыл бұрын
I have been repetedly having the same issue, there is this user Искандар Ходжаев below that proposes to eliminate completely the previous reference to the create order customer in Dashboard, in my case I had also commented out that line and it was not working, I wrote it again right now and it is working fine. I also tried a second time, to leave the button (instead of deleting it) and faced the same issue. So I guess it was true that the interpreter was not acknowledging the symbols. Any idea of that?
@oscarrin3
@oscarrin3 4 жыл бұрын
Yes i am having the same exact issue :S
@1santyjara
@1santyjara 4 жыл бұрын
Perfect video!!!!, what if I want to add ynamically a form to a formset ???
@zacharynguyen
@zacharynguyen 4 жыл бұрын
I still have the problem with ['ManagementForm data is missing or has been tampered with']. Can you tell me why? Here are my codes: ******* def createOrder(request,pk): OrderFormset = inlineformset_factory(Customer,Order,fields=("product",'status')) customer=Customer.objects.get(id=pk) formset = OrderFormset(instance=customer) #form = OrderForm(initial={'customer':customer}) if request.method == 'POST': #form = OrderForm(request.POST) formset = OrderFormset(request.POST, instance = customer) if formset.is_valid(): formset.save() return redirect('/') context = {'formset':formset} return render(request,'accounts/order_form.html',context) ******* {% extends 'accounts/main.html' %} {% load static %} {% block content %} {% csrf_token %} {{ formset.management_form }} {% for form in formset %} {{ form }} {% endfor %} {% endblock %}
@elnazdehkharghani6121
@elnazdehkharghani6121 4 жыл бұрын
Check the source code then you can solve it, because it is different from video code !
@furkhanmehdi6405
@furkhanmehdi6405 4 жыл бұрын
fields=('product','status')
@rushendrarushi
@rushendrarushi 4 жыл бұрын
Nice tutorials, wonderful content. i have been watching the playlist since morning this is pretty neat. i was able to understand each and everything
@KamranMmmdv
@KamranMmmdv 4 жыл бұрын
Create a Udemy course, man, let us pay for these perfect tutorials.
@julianbazanaguirre8439
@julianbazanaguirre8439 4 жыл бұрын
you can go to the link where the source code is, and donate money for this. I think it truly deserves to get some good feedback monetary speaking because the content is absolutely gold!
@EOO-Stand
@EOO-Stand 4 жыл бұрын
@@julianbazanaguirre8439 in total agreement
@pameng5235
@pameng5235 4 жыл бұрын
Salam.pulu olmayan neynesin
@shawnbeans7389
@shawnbeans7389 3 жыл бұрын
8:20 "i just want you to be funnier with this" lol
@ssd7199
@ssd7199 3 жыл бұрын
i can't save data what can i do ?
@shawnbeans7389
@shawnbeans7389 3 жыл бұрын
@@ssd7199 whats your error?
@ssd7199
@ssd7199 3 жыл бұрын
@@shawnbeans7389 i don't have any error but data can't save and redirect to dashboard page any idea to slove this problm
@shawnbeans7389
@shawnbeans7389 3 жыл бұрын
@@ssd7199 make sure you do action="post" in your html when posting data
@ssd7199
@ssd7199 3 жыл бұрын
@@shawnbeans7389 yes i make it but no save action
@neerajpandey4354
@neerajpandey4354 4 жыл бұрын
sir plz tell me that how can i customize formset in this (add css in button in formset plz answere)
@successpointcollegeofficial
@successpointcollegeofficial 4 жыл бұрын
Please make a more advance course. We will ready to pay you. Amazing tutorial. This is a real tutorial with point to point understanding.
@ayushvanvary
@ayushvanvary Жыл бұрын
my update method not working is this because of deprecation or else, delete create are working but after formset update is not working
@mohammedqadir3851
@mohammedqadir3851 4 жыл бұрын
You are great Sir Thank you creating Django series and it's really Helpful for me. Really Thank you
@DennisIvy
@DennisIvy 4 жыл бұрын
My pleasure :) Thank you for leaving feedback. This helps me alot.
@Mizuh4
@Mizuh4 Ай бұрын
Can someone help me arrange the fields inline? My formset automatically creates forms with DIVs in a block format. Thank you!
@jamesarthur2120
@jamesarthur2120 3 жыл бұрын
form = OrderForm(initial ={'customer': customer}) is not auto filling the customer's name in the forms
@kimjay6806
@kimjay6806 2 жыл бұрын
I'm aware this is coming after 4months, but for anyone who is confused: remove the "else" code bit. else: form = OrderForm() with: " form = OrderForm(initial ={'customer': customer}) " towards the top of the createOrder function, you are creating an OrderForm instance (" form ") which is temporairly loaded (at runtime) with the values in the " initial " dictionary. If you continue to have that bit of code along with the "else" code (towards the bottom of the function), the "else" code bit takes precedents (because the code is read from top to bottom) and ignores populating the form with what's in the initial dictionary. The "else" code creates an unbounded form instance. Hope it makes sense.
@kapitankidlattv9613
@kapitankidlattv9613 Жыл бұрын
Followed everything still the form not saving, :( I do not know anymore what I am missing..any help?
@pythonsalone
@pythonsalone 3 жыл бұрын
Denis I wish I can steal your brain. You are an amazing instructor. Thank you alot for this wonderful tutorial.
@yosetful
@yosetful 3 жыл бұрын
Great tutorial!!! Btw... Is there a way to pass two instances?? For example one will be a Profile model (just like this tutorial) AND the other model is "Proyect", which should have just the proyects of the user logged
@DHANANJAYBHADAURIA
@DHANANJAYBHADAURIA 4 жыл бұрын
this is exactly what I was searching. thank a lot
@rubendariohernandezcenteno5259
@rubendariohernandezcenteno5259 2 жыл бұрын
How could I create an Costumer and add their Order in the same form? as in the Django Admin.
@ulvimehdiyev8500
@ulvimehdiyev8500 3 жыл бұрын
when I create order and submit it ives error with pk=id, I just fix it like this def createOrder(request,pk): if request.method=='POST': form=OrderForm(request.POST) if form.is_valid(): form.save() return redirect('/') customer=Customer.objects.get(id=pk) form=OrderForm(initial={'customer':customer}) context={'form':form} return render(request,'accounts/order_form.html',context)
@AI4Productivity
@AI4Productivity 4 жыл бұрын
kindly make tutorial on dependent/chained select options. Like Car Make, Model and trim. if user selects a Car make then next select box should show models of only the selected car make, and then trim select option should be according to the selected model.
@cubixcolor
@cubixcolor 2 жыл бұрын
How to save this 5 products and status in one bill Example: 1.productname status 1.productname status 2.productname status 3.productname status 4.productname status 5.productname status
@actionscene100
@actionscene100 Жыл бұрын
You are doing a great job... But you have to work on your camera, from the eleventh video, it became blur
@Ambition-Tomoh
@Ambition-Tomoh 3 жыл бұрын
please how to add select2 in product to choice easy if large amount of choices please I try to add and do java to html not work
@redrum4486
@redrum4486 2 жыл бұрын
you a real G for this one Dennis
@IiVaNaAa13
@IiVaNaAa13 4 жыл бұрын
Hi, you are great, I really enjoy this course, but I have question. After adding formset, update button is not working, how to fix that?
@DennisIvy
@DennisIvy 4 жыл бұрын
Yes, sorry about that. I updated this in the source code but I'll make a video fixing this bug soon. The problem is that in "order_form.html" we reference the "formset" but in the "updateOrder" we pass in "form". The fix for now is to change the context dictionary in the "createOrder" view to pass in the formset as form: context = {'form':formset}. Then change the name in order_form.html for "form" instead of formset & loop the the form by field: {% csrf_token %} {{ form.management_form }} {% for field in form %} {{field}} {% endfor %} Hope this makes sense for now. I'll make a video soon on this.
@IiVaNaAa13
@IiVaNaAa13 4 жыл бұрын
@@DennisIvy Thank you, I saw changes for order_form in source code, but havent for context in createOrder. . It works now, thanks for explanation, you are really great!
@DennisIvy
@DennisIvy 4 жыл бұрын
@@IiVaNaAa13 Awesome! Sorry about the error, Keep at it my friend :)
@julianbazanaguirre8439
@julianbazanaguirre8439 4 жыл бұрын
@@DennisIvy ok, I see what u mean, and thanks for posting the solution here. Could you please explain why is this happening? Because when I click submit after completing more field, it doesnt call the updateOrder view, or does it? I am bit confused here. I placed the fix u mentioned and it is working now.
@JustPython
@JustPython Жыл бұрын
How can inline form update and add more button.. Only django
@rubendariohernandezcenteno5259
@rubendariohernandezcenteno5259 2 жыл бұрын
Finally i found you :v ... Thanks for your content :)
@ribeiroWilliam
@ribeiroWilliam 3 жыл бұрын
what if I want to do both? have a button to create a new order from scratch but also have a button in the customer page where the customer information will be automatically pulled
@robertochirivi7968
@robertochirivi7968 4 жыл бұрын
Thanks for your passionate work , great tutorial indeed !!
@GodwinStefanSalvatoreAddo
@GodwinStefanSalvatoreAddo 4 жыл бұрын
Quick question. I have several forms in one view function, it all works fine and flawlessly, but i cant seem to add the inline formsets to work correctly with the rest. i have tried everything i know so far and also read documentations online, have you implemented such a logic? if yes, how did you do it correctly?
@SimonePGGG
@SimonePGGG 4 жыл бұрын
Yes ok but how to make it dynamic so with an add button below. Because this would give the right UX
@mayanktripathi4u
@mayanktripathi4u 4 жыл бұрын
Thanks for sharing such a good tutorial. In the inline formset, could you please put some light on how we can do dynamic add new row for Order... instead of relying on extra parameter in inlineformset_factory. I mean customer can keep adding new order if he wish else default display 1 or 2.
@prajithkrish5230
@prajithkrish5230 4 жыл бұрын
I am searching the whole internet to do that but I still couldn’t get it , it would be a life saver if he shows how to do that !
@youssefelotmani4206
@youssefelotmani4206 3 жыл бұрын
@@prajithkrish5230 there are many videos made with javascript
@letscodemore
@letscodemore 2 жыл бұрын
You can follow this tutorial: www.letscodemore.com/blog/django-inline-formset-factory-with-examples/
@akshayjain8110
@akshayjain8110 3 жыл бұрын
what is difference between "initial" used here to pre-fill the form field and "instance" used in updateOrder form
@3DGFan9000
@3DGFan9000 2 жыл бұрын
How would we make the number of items dynamic rather then setting for example 10 like you did? How would i add a button to add another row?
@rdarktemplar1989
@rdarktemplar1989 3 жыл бұрын
any knowlede about rendering validation errors on dynamic added fields? :x
@abdulselamtamene5812
@abdulselamtamene5812 3 жыл бұрын
best, the way you teach ,everything awesome
@entertechinc
@entertechinc 3 жыл бұрын
Hi Dennis, awesome tutorial keep it up man! I have a small issue with initializing the order form with the current instance of the customer. I have followed your code but mine does not populate the customer field . Any suggestion ? Thank you.
@purplejelly24
@purplejelly24 3 жыл бұрын
I've been looking for this!! Really appreciate this tutorial!! :)
@davidbrown2806
@davidbrown2806 4 жыл бұрын
We can you only place one item per order, should this be changed to allow for multiple line items ? What about ordering packages ie some computer component companies generate build lists for computer builds of various attributes and prices. How cool would it be to create a 'package list' as a item, order that item and it automatically generates a multiple line order of the individual components. Just a thought. Also looks like the timestamp in settings.py has not been set for the proper timezone. Either that or format the Date Order to drop the time.
@euriperez9586
@euriperez9586 4 жыл бұрын
Nice Tutorials series, i know this question is not great, but how to get ride of the "-----------" in choices fields, i tried to add a blank tuple in the choices field but still the same
@mdjbanuelos1897
@mdjbanuelos1897 4 жыл бұрын
Give us more django tutorials Dennis!!
@joachimkre5682
@joachimkre5682 3 жыл бұрын
Bon tuto, puis-je avoir un exemple détaillé de django formtools combiné à un formset. J'ai déjà regardé la documentation. Merci
@faizanfareed9076
@faizanfareed9076 4 жыл бұрын
Welcome to KZbin 😊
@DennisIvy
@DennisIvy 4 жыл бұрын
Thank you :)
@successpointcollegeofficial
@successpointcollegeofficial 4 жыл бұрын
Very nice video thank you so much! I love your tutorial. Sir one thing just I have to ask. Order form after submitting the form and redirecting to the dashboard reverse error is showing. How can I fix that one? Please tell me. Thanks in advance.
@iskanarm
@iskanarm 4 жыл бұрын
I did everything as in the video, but it gives such an error, (Reverse for 'create_order' with no arguments not found. 1 pattern (s) tried: ['create_order / (? P [^ /] +) / $'] ) help, who also encountered this problem
@iskanarm
@iskanarm 4 жыл бұрын
The problem is resolved. In no case do not write comments in the html dock, the django may misunderstand them
@exceptionalfaruk7388
@exceptionalfaruk7388 4 жыл бұрын
@@iskanarm Love you man. Thanks
@TheZooj
@TheZooj 4 жыл бұрын
hey - how did you fix this? I am getting similar error : Reverse for 'create_order' with arguments '('',)' not found. 1 pattern(s) tried: ['create_order/(?P[^/]+)/$']
@pranay..
@pranay.. 4 жыл бұрын
Thank you man. You saved me
@EOO-Stand
@EOO-Stand 4 жыл бұрын
@@TheZooj I am looking for the same help
@digitaldata-surveying
@digitaldata-surveying 3 жыл бұрын
How can implement multiple models in one view with one to one relationship and shared model Example: I wants to make reports (daily, weekly and monthly) All reports must have a project to report about, and must have two extra models (staff workers and.....) and (machines cars and ......) So I can’t figure the relationship Please help.
@vineetsharma4121
@vineetsharma4121 4 жыл бұрын
At 9:56 can't we just do formset = OrderFormSet() so as avoid polpulating the formset?
@rdarktemplar1989
@rdarktemplar1989 3 жыл бұрын
also... would it be possible to have a formset where one of the initial values is either a formset or inline formset? :o
@nabindahal2340
@nabindahal2340 3 жыл бұрын
How can we store multiple form in database??
@bohdanbashuk7580
@bohdanbashuk7580 3 жыл бұрын
Where do you get names or labels of the fields in your form? PS: great tutorial
@johnventrella543
@johnventrella543 4 жыл бұрын
Is it possible to do a dependent drop down list with an inline formset?
@Jakob1206
@Jakob1206 4 жыл бұрын
Hi Dennis First and foremost thank you so much for your amazing content. Would it be possible to do a video about chained input fields using model forms? Best regards from Denmark
@nehat786
@nehat786 4 жыл бұрын
How should i add more field to child model. As its now 5 or 7! If i get more child field then what should I do.
@girishparate895
@girishparate895 3 жыл бұрын
how can we add forms dynamically in formset?
@harwinderthakur9708
@harwinderthakur9708 4 жыл бұрын
Thanks for the great series . at 9:54 can't we just take out the instance argument from the OrderSetForm() rather than passing querset none. It worked fine for me taking the instance out of there let me know if it can cause problem.
@raghavluthra4314
@raghavluthra4314 4 жыл бұрын
We have to specify the parent model for the orders. Otherwise how would you link the submitted orders to a particular customer?
@gauravquant8034
@gauravquant8034 3 жыл бұрын
You are a life savor man!!!
@weitingteng3241
@weitingteng3241 3 жыл бұрын
Hi Dennis, first thanks for great and also clear series. I bump into one question which is "inlineformetset" would automatically hide the foreign key from the form, however it's not what I looking for. Wondering is that possible to show FK? thanks
@hichambenhammouda7368
@hichambenhammouda7368 Жыл бұрын
any luck ?
@antonioinochi9170
@antonioinochi9170 3 жыл бұрын
Is there a way to do the same with createview??
@technoinfoworldwide2329
@technoinfoworldwide2329 4 жыл бұрын
you forget to update button for inlineformset. plz fix this
@DennisIvy
@DennisIvy 4 жыл бұрын
I just replied to another comment notifying me of this. Thanks for the heads up, I'll add a video soon on this but for now I'll just paste in my response to the last comment. "The problem is that in order_form.html we reference the "formset" but in the "updateOrder" we pass in "form". The fix for now is to change the context dictionary in the "createOrder" view to pass in the formset as form: context = {'form':formset}. Then change the name in order_form.html for "form" instead of formset & loop the the form by field: {% csrf_token %} {{ form.management_form }} {% for field in form %} {{field}} {% endfor %} Hope this makes sense for now. I'll make a video soon on this. "
@tochukwuaniukwu5173
@tochukwuaniukwu5173 4 жыл бұрын
Thanks so much Sir...So helpful. Please need part 13..please...of crm
@user-qb1sc3vx4e
@user-qb1sc3vx4e 4 жыл бұрын
this tutorial is super i have ever seen
@aliasgartaksali6298
@aliasgartaksali6298 3 жыл бұрын
Hey, please make a video on importing data through views with django-import-export
@ranaarifsb
@ranaarifsb 4 жыл бұрын
Hi! I am using modelformset_factory and trying to save data on different data base like form.save(using=“abc”) This work fine with form but when using with modelformset shows an error that un aspected argument “using” How to solve please
@Schlumpfpirat
@Schlumpfpirat 3 жыл бұрын
What about saving (Inline) Formsets that have a Unique Constraint? When getting already existing values from the database with the intent to update them, it tries to insert them instead, resulting in an error. How do you handle that?
@roderickdanzing1414
@roderickdanzing1414 3 жыл бұрын
i dont have that view button not included on your tut why?
@ahmedmaher672
@ahmedmaher672 3 жыл бұрын
How can i filter foregn key in formset based on login user?
@zorojuro5106
@zorojuro5106 4 жыл бұрын
hii what is the syntax theme that u are using
@DennisIvy
@DennisIvy 4 жыл бұрын
I just added bootstrap for styling.
@pawanchhangani7528
@pawanchhangani7528 4 жыл бұрын
What about forms.py file than i guess we should remove that because now we are using inlineformset?
@imtiyazgm
@imtiyazgm 3 жыл бұрын
Thank you Dennis!
@TheLotteryJack
@TheLotteryJack 3 жыл бұрын
While at placing a new order at 0:25, you say a customer information is already prefilled (customer name), but later in crash course you dont add that code. I tried adding {{customer.name}} in the template create_order.html, but a customer name doesnt show. Anyway, great tutorials.
@TheLotteryJack
@TheLotteryJack 3 жыл бұрын
I solved this if anyone else needs this info. You have to put "customer" into context = {} in createOrder to render it in template create_order.
@grzegorz-gregmika8339
@grzegorz-gregmika8339 4 жыл бұрын
Again great job! I like your pace and how you explain things. Please keep on. I have a question, how to handle this Delete section. I removed it in js but I don't like it: document.querySelectorAll("[id$='-DELETE']").forEach(e=>{ e.remove(); }); document.querySelectorAll("[for$='-DELETE']").forEach(e=>{ e.remove(); });
@DennisIvy
@DennisIvy 4 жыл бұрын
Can you send me your source code? I think i see what you are trying to do but I don't know enough to give you the best answer. (send to dennisivy11@gmail.com) Are you trying to select multiple orders in a checkbox's and delete in one submission?
@rababmahdi2920
@rababmahdi2920 4 жыл бұрын
Wow great. Exactly what i m searching. Thank you. It'll help me a lot.
@DennisIvy
@DennisIvy 4 жыл бұрын
Happy to hear that!
@banaras.wala.foreignaala
@banaras.wala.foreignaala 4 жыл бұрын
So far so good
Using the Inline Form Set Factory in Django (Part 1 of 2)
19:31
Pretty Printed
Рет қаралды 58 М.
拉了好大一坨#斗罗大陆#唐三小舞#小丑
00:11
超凡蜘蛛
Рет қаралды 16 МЛН
طردت النملة من المنزل😡 ماذا فعل؟🥲
00:25
Cool Tool SHORTS Arabic
Рет қаралды 32 МЛН
Glow Stick Secret Pt.4 😱 #shorts
00:35
Mr DegrEE
Рет қаралды 18 МЛН
Django Skills Roadmap To Getting A Job
17:31
Dennis Ivy
Рет қаралды 67 М.
Easily Convert Django Function Based Views To Class Based Views
11:58
Shopping Cart Setup - Django Wednesdays ECommerce 11
10:32
Codemy.com
Рет қаралды 12 М.
A Quick Intro to Model Formsets in Django
10:37
Pretty Printed
Рет қаралды 38 М.
Password Reset Email | Django (3.0) Crash Course Tutorials (pt 20)
19:28
Watch This Before Using Django With MongoDB
9:18
Dennis Ivy
Рет қаралды 43 М.