So in the first part of DJango course Mosh show us how to query a generic relation and in the view he is using TaggedItem.object.get_for_model(Product) to get the content type. But what if i want the parameter for the get_for_model to be dynamicly calculated, lets say i want the have the ImageViewSet that can automaticly determine if i have a Product or an Article etc
Related topics
Topic | Replies | Views | Activity | |
---|---|---|---|---|
Lesson 6.15 Using Generic Relationships important import | 3 | 379 | April 8, 2024 | |
ContentTypes, LikedItem, TaggedItem implementation? | 1 | 554 | March 10, 2022 | |
Admin Site Lesson 15 - NameError: 'TaggedItem' is not defined | 1 | 448 | February 10, 2022 | |
How to filter Products with tags app we made in django course part 1 | 0 | 301 | September 15, 2021 | |
Implementing Likes in Django Course | 0 | 156 | June 2, 2024 |