Using the Inline Form Set Factory in Django (Part 1 of 2)

  Рет қаралды 59,654

Pretty Printed

Pretty Printed

Күн бұрын

Пікірлер: 59
@prettyprinted
@prettyprinted 4 жыл бұрын
Join my free course on working with the database and models in Django: prettyprinted.com/djangodatabase
@irfanharun
@irfanharun 2 жыл бұрын
Thank you so much for making this video. I was stuck for 2 days in a complex form and was able to resolve it after i got my basics clear by watching this video. you are awesome
@malikrumi1206
@malikrumi1206 2 жыл бұрын
One of your better tutorials, Congrats.
@joseh5085
@joseh5085 4 жыл бұрын
Nice video man and really helpful!!. I was wasting a lot of time trying to make inline forms
@derekkroeker4582
@derekkroeker4582 2 жыл бұрын
I need 1 ModelForm and 2 inlineformset_factory, how can I do that in one CreateView?
@AlejandroPerezCosio
@AlejandroPerezCosio 3 жыл бұрын
Exactly what I needed, Thank you!
@muhammadarsalan3229
@muhammadarsalan3229 2 жыл бұрын
Hi Anthony, I was going through your video series on formset and it is well explanatory. So thank you for this. One thing I was facing a problem with inlineform factory is that How to create a parent model entry and multiple child model entries at the same time. I mean keeping instance=None
@ytg6663
@ytg6663 2 жыл бұрын
Any solution??
@vilenczi
@vilenczi 2 жыл бұрын
Hi Anthony, thanks for the great video. I was wondering, I have a use-case where to the same parent model I'd want to choose from multiple models (and the related forms). As an example related to this video would be: - you pick the Programmer as a parent the same way as is here (/1, /2...etc) - next in a drop-down box you'd choose what form-set to show : Languages AND / OR Hobbies - depending on that choice you'd have the appropriate form displayed And the rest of the saving logic I guess would be the same. Could this be done with model or inline formsets? Thanks a lot.
@godspower_eze
@godspower_eze 4 жыл бұрын
Please could you make a video on how to user modelforms inside of inlineformset factory and how to display errors while using them
@fadyghalayiny1920
@fadyghalayiny1920 4 жыл бұрын
Hi and thanks for your great videos just having one question how can I include current logged in user without showing it in the form Thanjs for any help
@Websk00l
@Websk00l 4 жыл бұрын
This was great! just a quick question, so I am using django all auth for user registeration how can I take the email from that to use as a primary key for my other model ? The other model has the data before the user sign up and verifies.
@steve4718
@steve4718 3 жыл бұрын
PERFECT example of what I'm doing
@rezasadeghi2520
@rezasadeghi2520 4 жыл бұрын
how can we Createview preferably CBV a model with its inlines ? Thanks
@ericxls93
@ericxls93 3 жыл бұрын
This is great, can you add a button to add extra fields (rather than refreshing the page)…
@paulonzervoulakus2685
@paulonzervoulakus2685 5 жыл бұрын
Just a simple question. Can you explain the formset using modelformset_factory in template it added a single blank inputfield, but using inlineformset_factory it added 3 blank inputfield. what is the usecase for both as the modelformset_factory is having 1 extra blank inputfield and the other one has 3 extra blank inputfield
@prettyprinted
@prettyprinted 5 жыл бұрын
Normally you would add one regular model at a time, so that's why you get one field by default. With an inline model, you would expect to be able to add as many as you would like, so they give you three to start with. An example of a regular model would be a form that takes in the name of a product. An inline model would be all the colors of that product.
@alekszmaalmen7559
@alekszmaalmen7559 4 жыл бұрын
Hi=) Your tutorial relies an existing model of Programmer. And if i wanna render a blank inlineformset_factory form, if i'm gonna create a programmer and specify all his languages in a single form as an inlineformset_factory form?
@muhammadarsalan3229
@muhammadarsalan3229 2 жыл бұрын
you figured out with this problem please tell me the solution
@niteshchaudhary2094
@niteshchaudhary2094 3 жыл бұрын
I want to use {% for f in formset %} {{ f.name }} {% endfor %} django.core.exceptions.ValidationError: ['ManagementForm data is missing or has been tampered with'] How to solve this issue???
@deepdrops
@deepdrops 3 жыл бұрын
Awesome! Congrats and Thank you!
@alexissilva6663
@alexissilva6663 4 жыл бұрын
thank you, your tutorial is awesome :)
@ManishJindalmanisism
@ManishJindalmanisism 5 жыл бұрын
hi Anthony. I have a query here. In a project in my organization we are using inlines in admin.py only. I can see two inlines for the main Model Author - books and articles. Both books and articles model have parent child relationship with Author. Now in admin.py we are using formset for books (extending baseinlineformset) and using object of class made by extending BaseInlineFormset in BooksTabularInline. But for Articles we are simply using ArticlesTabularInline. We are not using formset at all. Why this distinction? Can you please clarify where to use formset in admin.py ? What is advantage of using fomset over simple tabularinlines? I will be happy to share admin.py source code if my question is not clear
@sandeshkharat2273
@sandeshkharat2273 4 жыл бұрын
hey...How to use Inlineformset factory with Class based view....
@khadimhusen
@khadimhusen 5 жыл бұрын
Very good informative tutorial. Can you make tutorial on How to create Like django admin Tabular inlineform. From scratch in our app
@addohm
@addohm 5 жыл бұрын
Could you make a video on how you set up your windows 10 + ububtu + python venv environment?
@prettyprinted
@prettyprinted 5 жыл бұрын
I'll consider that. Thanks for the idea.
@chrisogonas
@chrisogonas 2 жыл бұрын
Superb!
@Johnnyboycurtis
@Johnnyboycurtis 5 жыл бұрын
Awesome tutorial!
@prettyprinted
@prettyprinted 5 жыл бұрын
Thanks for watching!
@richardlong2412
@richardlong2412 5 жыл бұрын
do you have a udemy course?
@prettyprinted
@prettyprinted 5 жыл бұрын
Yes, you can go here to see what's available: www.udemy.com/user/anthony-herbert-2/
@richardlong2412
@richardlong2412 5 жыл бұрын
Any chance you have Django course? I only see flask? You give great examples and easy to follow videos.
@prettyprinted
@prettyprinted 5 жыл бұрын
@@richardlong2412 For now, I only have a Django course on my website: prettyprinted.com
@aksel58
@aksel58 5 жыл бұрын
Thanks for this tutorial! Could you please answer how to add parent fields to the resulting form? For example, programmer name?
@rodriguitocaicedo
@rodriguitocaicedo 4 жыл бұрын
In the fields tuple, add the programmer field. It will show a dropdown with the programmer name, because of the ForeignKey relationship.
@themarksmith
@themarksmith 6 жыл бұрын
Happy new year - just an observation - I like your content but as a Django newbie, some of your videos on Django seem a bit advanced and leave me feeling that they may not be for me at the level I am at - I'm sure others may feel the same so as (hopefully) a helpful suggestion - it might be better if you explain and show an 'idiot proof' practical example of what you are going to be covering at the start of each video as I feel it would help with engagement... as I said I like your content so this is not meant to be a criticism as such... cheers
@sinancetinkaya
@sinancetinkaya 6 жыл бұрын
Anthony already has "Django Tutorials" playlist and it starts from beginner level to advanced. kzbin.info/aero/PLXmMXHVSvS-DQfOsQdXkzEZyD0Vei7PKf
@themarksmith
@themarksmith 6 жыл бұрын
@@sinancetinkaya Thanks for the link - I totally see what your saying but I can't help but feel that doing a recap like I have suggested in my original comment would help with engagement from newbies with his videos - I think 30 seconds or so at the very start just explaining the concept and showing a practical example would really help turn newbies on to his great content... I think the majority of people are not going to watch a long playlist and come back but they might if they can see the practical use of the more advanced concept he is covering in each video...
@jonathanwarner2420
@jonathanwarner2420 6 жыл бұрын
@@themarksmith "I think the majority of people are not going to watch a long playlist..." If you are not ready to learn the basics (e. g. of a long playlist), you should not try to program.
@themarksmith
@themarksmith 6 жыл бұрын
@@jonathanwarner2420 Thanks for your input - my comment was designed to help Anthony increase his viewership - there are a lot of channels on KZbin on Django and programming in general and a lot of them either assume that they are the only source of information on the subject and try to spoon feed you their way of doing things or they seem to be simply using their channel to reinforce their own learning... Anthony appears to be trying to make a business out of Flask/Django tutorials so my comment was aimed at providing a helpful suggestion to help him with this... For example, even though I have found some of these videos on this channel useful I have also found myself feeling that I have wasting my time on a lot of them as the subject was not explained very clearly or was based on a vague premise - this has lead me to move to other YT channels for Django learning and I have identified the reason behind my doing this is that they give better practical examples of the whats and whys of the subjects they are covering... These other channels also have more views than a lot of the videos on this channel - which is a shame as this guy deserves more views (and add revenue)for his hard work...
@jonathanwarner2420
@jonathanwarner2420 6 жыл бұрын
@@themarksmith May be he should make a note in his Tutorial-Title, e. g. Beginner, Intermediate/Advanced or sth. else. This tut for example was an inquiry of his subscribers in the comments of another form-tutorial. May be an advanced tag would have helped. "... which is a shame as this guy deserves more views" I totally agree!
@esportsnexus
@esportsnexus 6 жыл бұрын
Please make some project series
@prettyprinted
@prettyprinted 6 жыл бұрын
I definitely will.
@addohm
@addohm 5 жыл бұрын
This video is specific to editing an objects children. What if I want to create an parent and modify it's children all in one go?
@MackyBaka000
@MackyBaka000 5 жыл бұрын
Yeah... I think this tutorial is impractical and stupid.
@muhammadarsalan3229
@muhammadarsalan3229 2 жыл бұрын
Hey did you figured out the solution if yes please tell me the solution
@hebertvillafuerte7223
@hebertvillafuerte7223 5 жыл бұрын
please.. tutorial code?
@prettyprinted
@prettyprinted 5 жыл бұрын
Here you go: prettyprinted.com/l/kGg
@mayanktripathi4u
@mayanktripathi4u 5 жыл бұрын
Hi, could you please explain us the management_form in Django with an example.
@prettyprinted
@prettyprinted 5 жыл бұрын
OK, I'll consider making a video about it.
@thatsenam9183
@thatsenam9183 4 жыл бұрын
Its complicated
@MackyBaka000
@MackyBaka000 5 жыл бұрын
This is stupid! Why do you have to save the programmer first before you can save any language/s? Why not create a new programmer along with new languages in the same form?
@onlysolo
@onlysolo 3 жыл бұрын
yes this is much more interesting and useful and what i was searchign for , but still the tutorial is ok as an inctroduction
@muhammadarsalan3229
@muhammadarsalan3229 2 жыл бұрын
If you figured out the solution please let me know please
@MackyBaka000
@MackyBaka000 2 жыл бұрын
@@muhammadarsalan3229 I already did but I already moved on from using Django. I'm more focused right now on Rust development. I'm not sure if I still have my codes.
@muhammadarsalan3229
@muhammadarsalan3229 2 жыл бұрын
@@MackyBaka000 ok thanks
@MackyBaka000
@MackyBaka000 2 жыл бұрын
@@muhammadarsalan3229 Give me your email address so I can send the codes if I find them.
Useful Inline Form Set Options in Django (Part 2 of 2)
5:25
Pretty Printed
Рет қаралды 16 М.
A Quick Intro to Model Formsets in Django
10:37
Pretty Printed
Рет қаралды 38 М.
Support each other🤝
00:31
ISSEI / いっせい
Рет қаралды 81 МЛН
Арыстанның айқасы, Тәуіржанның шайқасы!
25:51
QosLike / ҚосЛайк / Косылайық
Рет қаралды 700 М.
Django Dynamic Forms Tutorial with Htmx
48:27
Matt Freire
Рет қаралды 70 М.
Learn the basics of Django's Model Managers and Querysets
19:38
Matt Freire
Рет қаралды 44 М.
Creating Forms From Models in Django With ModelForm
11:40
Pretty Printed
Рет қаралды 47 М.
How to deeply understand Angular signals (...or anything)
10:51
Joshua Morony
Рет қаралды 10 М.
Learn the Basics of Django Signals
22:37
Matt Freire
Рет қаралды 50 М.
Extend Your Django User Framework With a One To One Field
11:39
Pretty Printed
Рет қаралды 42 М.
Why Agent Frameworks Will Fail (and what to use instead)
19:21
Dave Ebbelaar
Рет қаралды 101 М.
Support each other🤝
00:31
ISSEI / いっせい
Рет қаралды 81 МЛН