Changing metadata defaults

3 views
Skip to first unread message

Barry

unread,
Jun 6, 2011, 11:32:03 AM6/6/11
to django-lfc
I'm creating a content type for talks. A Talk has a start, a speaker,
and a location along with all the other BaseContent info (title, slug,
description).

Talks are added to a parent object that represents the series of
talks. This is a TalkSeries object. It's essentially just a container
for Talk objects. Its template view shows talks divided into two
blocks: upcoming talks and past talks.

1. Ideally in the navigation portlet I'd only like Talk objects that
are in the future to be visible. But the navigation portlet code
checks the exclude_from_navigation field via a query set, and there's
no way I can see to override the query. Fix would be to write a new
modified navigation portlet - but that might get messy.

2. So I figured that since the talks were all listed on the
TalkSeries page there's no need to have them in the navigation
portlet. Could I make 'exclude_from_navigation=True' the default? An
override of the save() method for my Talk model class seems to work:

def save(self,force_insert=False, force_update=False):
self.exclude_from_navigation = True
super(Talk,self).save()

Anyone got ideas either on (1) or better ways of doing (2)? I thought
there may be a workflow-based solution, but workflows seem connected
with permissions, and I need all the talks to be public so anyone can
see what's been going on.

thx

Barry
Reply all
Reply to author
Forward
0 new messages