This is a good tutorial, well worth the 30 min investment. There is gain of knowledge by min 15.
@pinniramakrishna24676 жыл бұрын
Thanks you very much for your classes. I learnt a lot from your django and REST API classes. Please continue your videos Thanks you
@manikraichurakar45294 жыл бұрын
u r Don sir.... really thnx , even django docs also has no knowledge..
@philipmutua5 жыл бұрын
Thank you very much for the video. You have no idea how this has helped me alot! I had a problem with updating complex nested items ,with your tutorial now I'm good.
@alexandergarzo94152 жыл бұрын
Thanks for this tutorial, very helpful!
@kousiksekar18944 жыл бұрын
Very informative and useful content, Thanks for the post
@rahulsinghdhek6 жыл бұрын
Hello Aarav, Can you cover create/update of Many to many relationship where an associative table(3rd table) holds the relation of two tables. I am good with creating(POST) but facing hard time while updating. Gone through many stackoverflow questions as well , didn't help. A small example or any authentic website/link where I could find the Update of associative table. Thanks
@TahaKhan-tm7rh4 жыл бұрын
You Sir are a genius. Thanks a ton for uploading this video.
@vivekascoder4 жыл бұрын
I become you fan sir, your videos are amazing.
@tmacfan19925 жыл бұрын
Very thought through example, i find myself revisiting this video periodically
@thiagobueno34864 жыл бұрын
Me too haha
@tanimsk Жыл бұрын
Thank you so much! very helpful!
@elmehdilamrhari91816 жыл бұрын
thank you so much really you helped me with the "depth=1" :)
@aravindor5 жыл бұрын
Great tutorial 👍... Quentin Tarantino django in video tags 😂😂😂..
@brwaata30015 жыл бұрын
that was great you saved me in many problem
@rameshyelle28843 жыл бұрын
Thank you so much for sharing knowledge.
@tz20142 жыл бұрын
Appreciate Hardik for this amazing tutorial on DRF. id field in choices is ignore without doing like you did, it worked but I couldn't figure out why ?
@mohamadsajedi58574 жыл бұрын
You really help me my friend.... Thank You .Best Regards
@adithyanps81785 жыл бұрын
thank you so much ..really you saved my lot of time... sir, can you make a video about double nested serializer....
Nice video sir, can you upload annotate and aggregate concep witj django...
@jesusandrescabrerasuarez16365 жыл бұрын
excellent bro!!! thank you so much
@tejasmandre6664 жыл бұрын
Thankyou for making this!
@ІлляКадобянський2 жыл бұрын
U saved my ass, brov :)
@dennysam8296 жыл бұрын
This was so good!!
@ranuvijay14 жыл бұрын
nested serializers or joins in queryset, which one should we use for getting the data ?
@ahm3drn5 жыл бұрын
Thank You that's perfect
@ffiuca Жыл бұрын
hi, can hou help me why depth on my serilizers not working? just return flat data of jeon
@MarquisTaylor274 жыл бұрын
What if instead of sending "id":4, "text": "BMW", I need to just send "id":4. Since I'm doing an update not a create why do I need to re-add the choice? But if I don't get I get a valuation error? Is there anyway I can reload the choice instance before the validation?
@gowthamns82284 жыл бұрын
Is that possible to call like this without using primary and foreign key field in models.py ?
@gowthamns82284 жыл бұрын
@@HardikPatelN yeah, but i need to post the data, for example in I need to post username, email and phone from one model and address line, postcode etc from another model, from a single api, so i dont have any idea, but your code is telling something to me... so i don`t want to use many = True then its a right way?
@dgiri23334 жыл бұрын
How to do Nested Serializer for country select based on country list of States ,state select based on state list of filter district will return how to do using ....Using seralizer..
@kamtanath44946 жыл бұрын
Great Effort!
@nusk0036 жыл бұрын
Hello sir, thank you so much for the tutorial and I have a question... How to upload files or multipart content in drf??
@bhaaratsingh55956 жыл бұрын
Nice video.
@vinodreddy17226 жыл бұрын
Sir at 6: 40 ,here we are creating choice serializer object without passing any data to choice serializer , so how it is retrieving the data?
@niteshrawat5766 жыл бұрын
Choice model has fk with Question model.
@gowthamns82284 жыл бұрын
how to join two tables in serializer and perform crud operation(not a multiple inheritance)?
@gowthamns82284 жыл бұрын
@@HardikPatelN yeah but I don't have any idea about custom validation and all.. i need some more help or how the code will be like... Any idea or any source?
@deepakverma74814 жыл бұрын
Thanks a lot. But, how abt carryout out CRUD operation on 'choices' alone, along with display of question on read operation? Pls help
@deepakverma74814 жыл бұрын
@@HardikPatelN sir, it will be so nice if can send me example to carry out crud on choices along with questions on read
@dhanalm4 жыл бұрын
I have Author and Book models.In Book model, author is foreignkey. I want to display collection of books, for each author. So I have created property function in Author model and in Author serializer, I have added books in fields... But I'm only getting Book Id. I also want all fields of book.
@dgiri23335 жыл бұрын
Hi how to create nested serializer like if select district then it's show model list ,if model select all village can show on villages how to implement
@dgiri23335 жыл бұрын
@@HardikPatelNgive me your mail I'd
@dgiri23335 жыл бұрын
@@HardikPatelN I don't get you
@Alliswelltoday3 жыл бұрын
sir am getting error rquestion required after passing multiple choices
@hafeezshaik12214 жыл бұрын
Hi , I am using same process with mysql database, I am getting error like this 'Countries' is an invalid keyword argument for this function, please give me solution.Thank you
@uweopfern6 жыл бұрын
I am getting this error while trying to consume add new choice model, i am being told this ```IntegrityError at /api/choices/ (1048, "Column 'question_id' cannot be null")``` when i remove depth =1 , it works but when it is there , i get that error
@SACHINAGARWAL164 жыл бұрын
In your Question model class you have property declared returning function choice_set.() of self. I dont find choice_set in class!
@SACHINAGARWAL164 жыл бұрын
@@HardikPatelN thanks for reply. I tried inserting child without properties and it worked. But I wonder that when I change property name from choice_set to anything else it complains there is no such property in Question. Have no clue
@SACHINAGARWAL164 жыл бұрын
Hi.. Below is my class and error. It works all well when I use choice_set but breaks if I use anything else like below choice_set2. Not sure if this property choice_set2 should have reference anywhere else. class QuestionSerializer(serializers.ModelSerializer): choice_set2 = ChoiceSerializer(many=True) class Meta: model = Question fields = ('pub_date', 'question_text', 'choice_set2') Got AttributeError when attempting to get a value for field `choice_set2` on serializer `QuestionSerializer`. The serializer field might be named incorrectly and not match any attribute or key on the `Question` instance. Original exception text was: 'Question' object has no attribute 'choice_set2'.
@sarojpaudel74794 жыл бұрын
Thank you so much for the video sir. I have a problem. I have similar project where I have to do similar thing like above. But what i need is, I need to show only one choices (int=pk) of a question(int=pk). That means , similar endpoint like localhost/api/question/1/choices/1. how can we do that. Please help.
@sarojpaudel74794 жыл бұрын
stackoverflow.com/questions/64640122/i-have-to-pass-the-multiple-intpk-in-a-single-endpoint-for-django-rest-api This my actual problem.
@sarojpaudel74794 жыл бұрын
@@HardikPatelN cant we do this using GenericApiview?? do we have to use viewset?? because i am very comfortable using viewset? and what is mixins used for??
@sugiono28014 жыл бұрын
how to return a list choiches: ['bmw', 'audi'] from nested?
@thalariharsha81604 жыл бұрын
sir how to craete multiple foreginkey relation fileds in single table how u do that , i am grtting error, please do one video
@DirtySouth33T3 жыл бұрын
Great video, one question. How would you handle unique constraints with nested When trying to update or create I receive Software with this Software Name already exists, or Server with this Server Name already exists. How would you handle this? I have 2 models Software name unique=true slug Server name unique=true slug software m2m(Software)
@vikaskachwaya4385 жыл бұрын
how to update multiple fields of model at single request.
@saarpathak24224 жыл бұрын
Hi, Aarav I am trying a similar solution. But getting MainInventory() got an unexpected keyword argument 'group'. class MainInventorySerializer(serializers.ModelSerializer): class Meta: model = MainInventory fields = ( 'inv_id', 'inv_name' ) class MainGroupSerializer(serializers.ModelSerializer): inv_id = MainInventorySerializer() class Meta: model = MainGroup fields = ( 'group_id', 'group_name', 'inv_id' ) def create(self, validated_data): inv_data = validated_data.pop('inv_id') group = MainGroup.objects.create(**validated_data) MainInventory.objects.create(**inv_data, group=group) return group My Model class MainInventory(models.Model): inv_id = models.IntegerField(verbose_name='INVENTORY ID', primary_key=True) inv_name = models.CharField(verbose_name='INVENTORY NAME', max_length=512) class MainGroup(models.Model): group_id = models.IntegerField(verbose_name='GROUP ID', primary_key=True) group_name = models.CharField(verbose_name='GROUP NAME', max_length=512) inv_id = models.ForeignKey(related_name='group_inv', on_delete=models.SET_NULL, to='hosts.MainInventory', blank=True, null=True)
@manikraichurakar45294 жыл бұрын
TypeError: Direct assignment to the reverse side of a many-to-many set is prohibited. Use reportsTo.set() instead. can anybody tell the solution
@jesusandrescabrerasuarez16365 жыл бұрын
hey buddy, i need to store json array using ModelViewSet class.. everybody tells "you must override the update method", but i cant figure out how to solve it... i need some help to get on the way.. Can you help me bro? twitter: @jacsdev
@jesusandrescabrerasuarez16365 жыл бұрын
@@HardikPatelN i find a nice way to solve it, i just change a little the update method in viewsetmodel n then added this line: serializer = self.get_serializer(data=request.data, many=isinstance(request.data, list)) now, i can to invoke "put method" (update) with a json array and it works like a charm!... Thanks for your feedback bro.
@shreerangaraju10135 жыл бұрын
instance.choices.remove(instance.choices.get(id=choice.id)) instead of choice.delete().