Тёмный

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

Pretty Printed
Подписаться 96 тыс.
Просмотров 59 тыс.
50% 1

Опубликовано:

 

29 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 59   
@prettyprinted
@prettyprinted 4 года назад
Join my free course on working with the database and models in Django: prettyprinted.com/djangodatabase
@AlejandroPerezCosio
@AlejandroPerezCosio 3 года назад
Exactly what I needed, Thank you!
@derekkroeker4582
@derekkroeker4582 2 года назад
I need 1 ModelForm and 2 inlineformset_factory, how can I do that in one CreateView?
@ericxls93
@ericxls93 3 года назад
This is great, can you add a button to add extra fields (rather than refreshing the page)…
@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
@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
@joseh5085
@joseh5085 3 года назад
Nice video man and really helpful!!. I was wasting a lot of time trying to make inline forms
@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???
@themarksmith
@themarksmith 5 лет назад
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 5 лет назад
Anthony already has "Django Tutorials" playlist and it starts from beginner level to advanced. ru-vid.com/group/PLXmMXHVSvS-DQfOsQdXkzEZyD0Vei7PKf
@themarksmith
@themarksmith 5 лет назад
@@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 5 лет назад
@@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 5 лет назад
@@jonathanwarner2420 Thanks for your input - my comment was designed to help Anthony increase his viewership - there are a lot of channels on RU-vid 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 5 лет назад
@@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!
@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.
@sandeshkharat2273
@sandeshkharat2273 4 года назад
hey...How to use Inlineformset factory with Class based view....
@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
@steve4718
@steve4718 3 года назад
PERFECT example of what I'm doing
@rezasadeghi2520
@rezasadeghi2520 3 года назад
how can we Createview preferably CBV a model with its inlines ? Thanks
@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
@chrisogonas
@chrisogonas 2 года назад
Superb!
@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.
@deepdrops
@deepdrops 3 года назад
Awesome! Congrats and Thank you!
@alekszmaalmen7559
@alekszmaalmen7559 3 года назад
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
@malikrumi1206
@malikrumi1206 2 года назад
One of your better tutorials, Congrats.
@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.
@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??
@alexissilva6663
@alexissilva6663 4 года назад
thank you, your tutorial is awesome :)
@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.
@thatsenam9183
@thatsenam9183 4 года назад
Its complicated
@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 4 года назад
please.. tutorial code?
@prettyprinted
@prettyprinted 4 года назад
Here you go: prettyprinted.com/l/kGg
@esportsnexus
@esportsnexus 5 лет назад
Please make some project series
@prettyprinted
@prettyprinted 5 лет назад
I definitely will.
@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
@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.
@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.
@aksel58
@aksel58 4 года назад
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.
Далее
Python Django Forms tutorial
26:54
Просмотров 10 тыс.
Дикий Бармалей разозлил всех!
01:00
# Rural Funny Life Wang Ge
00:18
Просмотров 673 тыс.
pumpkins #shorts
00:39
Просмотров 19 млн
A Quick Intro to Model Formsets in Django
10:37
Просмотров 38 тыс.
Understanding Django Model Relationships
25:56
Просмотров 94 тыс.
Django Dynamic Forms Tutorial with Htmx
48:27
Просмотров 68 тыс.
Getting Started With Django REST Framework
26:31
Просмотров 199 тыс.
Дикий Бармалей разозлил всех!
01:00