Django ORM select_related rendering template

Django ORM select_related rendering template  #angularjs #reactjs

  • I was able to get the coefficients and display their games.
  • Stack Overflow works best with JavaScript enabled
  • class BaseView(View): data = dict() template = “index.html” def get(self, request): self.data[‘games’] = Game.objects.prefetch_related(‘gamecoefficient_set’).
  • I discribe in russian version link – Kamran XIDIROV 1 hour ago
  • I added a prefetch_related which will fetch the related model and join them in python (s. stackoverflow.com/a/31237071/246028 for an explanation) – Jann 54 mins ago

I was able to get the coefficients and display their games. Now in template displays repeating “game_code”. I find it difficult to display the game and its coefficients.

@ng_real_ninja: Django ORM select_related rendering template #angularjs #reactjs

I have this models in Django 1.10 version

after this ORM query

I was able to get the coefficients and display their games. Now in template displays repeating “game_code”. I find it difficult to display the game and its coefficients.

Django ORM select_related rendering template