On Dec 15, 2005, at 12:36 PM, coowwa coowwa wrote:
I want to have a daily list of links that will be displayed by
date. e.g.
December 15, 2005
link 1
link 2
link 3
December 14, 2005
link 1
link 2
link 3
[snip]
Does anyone have any suggestions about how to do this cleverly in
Django?
Any help is much appreciated! Thanks.
I would do something like this::
class DailyLinks(meta.Model):
day = meta.DateField(unique=True)
class LinkedItem(meta.Model):
day = meta.ForeignKey(DailyLinks, edit_inline=meta.TABULAR)
link_text = meta.CharField(maxlength=200)
link_url = meta.URLField()
class META:
order_with_respect_to = "day"
That'll create an item in the admin for each day of links with each
individual link edited inline on the days page, along with all the
reordering stuff you need.
Jacob