Hi folks,
(New to databasing)
I'm looking for a solution for presenting MySQL.
I want to display my data grouped by a colmn value in the MySQL table.
So my model is:
from django.db import models
class Genre(models.Model):
genre_type = models.CharField(max_length=40)
def __unicode__(self):
return self.genre_type
class Credit(models.Model):
date = models.DateField()
title = models.CharField(max_length=80)
company = models.CharField(max_length=80, blank=True, null=True)
genre = models.ForeignKey(Genre)
underwater = models.BooleanField('Underwater credit')
latest_tag = models.BooleanField('Display as recent credit')
def __unicode__(self):
return self.title
I want to extract all the "credits" and group them into genre and
display them inside a div with h5 both showing the genre:
<div class="commercials">
<h5>Commercials</h5>
<ul>
<li>Lidl</li>
<li>Flybe</li>
<li>Arnold Clark</li>
<li>Wholesale Domestic</li>
<li>Evening Times</li>
<li>Daily Record</li>
</ul>
</div>
to look like this:
http://www.davidlees.tv/lightingcameraman/
I've tried all sorts of stuff in my views.py file and it wont work.
Any help or pointers would be great. Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---