Hey! Am having a problem. And l request for your Help.
Am having 3 apps in Django project
- action
- adventure
- others
#action/ models.py
....
class Action(models.Model):
name=models.Charfield()
os= models.Charfield( choices=OS)....
#adventure/models.py
....
class Adventure(models.Model):
name=models.Charfield()
os= models.Charfield( choices=OS)....
#Others/views.py
from itertools import chain
from action.models import Action
from adventure.models import Adventure
def windows_games(request):
win_action = Action.objects.filter(os='windows')
win_adventure = Adventure.objects.filter(os='windows')
combined_list = list(chain(win_action,win_adventure))
context = ['combined_list':combined_list,]
return render(request, 'others/os/windows_game.html' , context)
#others/os/windows_game.html
.....
<div class="container">
<img src="{{combined_list.game_pic}}">
<p>{{combined_list.name}}</p>
.....
1). I need to correct me in #others/ views.py if there is any mistake done.
2). I would like to know how to know how to write the tag that outputs the
results in #others/os/windows_game.html because I tried that but outputs
nothing.
And l would like to be in form of,
#{{combined_list.game_pic}}, etc
Please help me.
I'm Samuel
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/CAGQoQ3zPgg7vfKGvQRFyOoYW_7fuM20DUSpzqeY7_uDyPX0agw%40mail.gmail.com.