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 | |
|---|---|---|---|---|
| ContentTypes, LikedItem, TaggedItem implementation? | 1 | 563 | March 10, 2022 | |
| How to filter Products with tags app we made in django course part 1 | 0 | 304 | September 15, 2021 | |
| Admin Site Lesson 15 - NameError: 'TaggedItem' is not defined | 1 | 464 | February 10, 2022 | |
| DjangoFilterBackend for TAGS on products (separate apps) | 0 | 251 | March 18, 2022 | |
| Lesson 6.15 Using Generic Relationships important import | 3 | 388 | April 8, 2024 |