Answer the question
In order to leave comments, you need to log in
How to implement such request in django?
Started learning Django.
How to make such a query to the database, in PHP I did this:
$fames = pg_query ($connect, "SELECT DISTINCT(ugods),(ugodp) FROM halloffames");
while ($row = pg_fetch_assoc($fames))
{
$ugods = $row['ugods'];
$ugodp = $row['ugodp'];
$famesact = pg_query ($connect, "SELECT * FROM halloffames WHERE ugods=$ugods AND ugodp=$ugodp");
while ($rowfamesact = pg_fetch_assoc($famesact)){
echo $rowfameact['....'];
}
}
def HallOfFame(request):
ugodlist= Halloffames.objects.values('ugods','ugodp').distinct()
for godlist in ugodlist:
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question