* (Optional) recaptcha-django r6 <http://code.google.com/p/recaptcha-django/>
* (Optional) south 0.7.2+ <http://south.aeracode.org/>
-To contribute, please visit the project website <http://philo.ithinksw.org/>.
+To contribute, please visit the project website <http://philo.ithinksw.org/>. Feel free to join us on IRC at irc://irc.oftc.net/#philo.
====
Using philo
--- /dev/null
+Philo is a foundation for developing web content management systems.
+
+Prerequisites:
+
+ * [Python 2.5.4+ <http://www.python.org>](http://www.python.org/)
+ * [Django 1.2+ <http://www.djangoproject.com/>](http://www.djangoproject.com/)
+ * [django-mptt 0.4+ <https://github.com/django-mptt/django-mptt/>](https://github.com/django-mptt/django-mptt/)
+ * (Optional) [django-grappelli 2.0+ <http://code.google.com/p/django-grappelli/>](http://code.google.com/p/django-grappelli/)
+ * (Optional) [south 0.7.2+ <http://south.aeracode.org/)](http://south.aeracode.org/)
+ * (Optional) [recaptcha-django r6 <http://code.google.com/p/recaptcha-django/>](http://code.google.com/p/recaptcha-django/)
+
+To contribute, please visit the [project website](http://philo.ithinksw.org/). Feel free to join us on IRC at [irc://irc.oftc.net/#philo](irc://irc.oftc.net/#philo>).
+
+Using philo
+===========
+
+After installing philo and mptt on your python path, make sure to complete the following steps:
+
+1. add 'philo.middleware.RequestNodeMiddleware' to settings.MIDDLEWARE_CLASSES.
+2. add 'philo' and 'mptt' to settings.INSTALLED_APPS.
+3. include 'philo.urls' somewhere in your urls.py file.
+4. Optionally add a root node to your current Site.
+
+Philo should be ready to go!
\ No newline at end of file
class NewsletterArticleAdmin(TitledAdmin, AddTagAdmin):
filter_horizontal = TitledAdmin.filter_horizontal + ('tags', 'authors')
+ list_display = ['title', 'date', 'author_names']
+ search_fields = ('title', 'authors__name',)
+ date_hierarchy = 'date'
+
+ def author_names(self, obj):
+ return ', '.join([author.get_full_name() for author in obj.authors.all()])
+ author_names.short_description = "Authors"
class NewsletterIssueAdmin(TitledAdmin):
def add_item(self, feed, obj, kwargs=None):
defaults = {
'title': obj.title,
- 'description': obj.excerpt or obj.content,
+ 'description': obj.content,
'author_name': obj.author.get_full_name(),
'pubdate': obj.date
}
'title': obj.title,
'author_name': ', '.join([author.get_full_name() for author in obj.authors.all()]),
'pubdate': obj.date,
- 'description': obj.lede or obj.full_text,
+ 'description': obj.full_text,
'categories': [tag.name for tag in obj.tags.all()]
}
defaults.update(kwargs or {})
view_about_to_render = Signal(providing_args=['request', 'extra_context'])
view_finished_rendering = Signal(providing_args=['response'])
page_about_to_render_to_string = Signal(providing_args=['request', 'extra_context'])
-page_finished_rendering_to_string = Signal(providing_args=['string'])
-
-
-def replace_sender_response(sender, response):
- """Helper function to swap in a new response."""
- def render_to_response(self, *args, **kwargs):
- return response
- sender.actually_render_to_response = render_to_response
\ No newline at end of file
+page_finished_rendering_to_string = Signal(providing_args=['string'])
\ No newline at end of file
self.template = None
def compile_instance(self, object_pk):
- self.object_pk = object_pk
model = self.content_type.model_class()
try:
return model.objects.get(pk=object_pk)
setattr(ConstantEmbedNode, LOADED_TEMPLATE_ATTR, property(get_embedded))
-def get_content_type(bit):
+def parse_content_type(bit, tagname):
try:
app_label, model = bit.split('.')
except ValueError:
- raise template.TemplateSyntaxError('"%s" template tag expects the first argument to be of the form app_label.model' % tag)
+ raise template.TemplateSyntaxError('"%s" template tag expects the first argument to be of the form app_label.model' % tagname)
try:
ct = ContentType.objects.get(app_label=app_label, model=model)
except ContentType.DoesNotExist:
- raise template.TemplateSyntaxError('"%s" template tag requires an argument of the form app_label.model which refers to an installed content type (see django.contrib.contenttypes)' % tag)
+ raise template.TemplateSyntaxError('"%s" template tag requires an argument of the form app_label.model which refers to an installed content type (see django.contrib.contenttypes)' % tagname)
return ct
raise template.TemplateSyntaxError('"%s" template tag must have at least two arguments.' % tag)
if len(bits) == 3 and bits[-2] == 'with':
- ct = get_content_type(bits[0])
+ ct = parse_content_type(bits[0], tag)
if bits[2][0] in ['"', "'"] and bits[2][0] == bits[2][-1]:
return ConstantEmbedNode(ct, template_name=bits[2])
return InstanceEmbedNode(instance, kwargs)
elif len(bits) > 2:
raise template.TemplateSyntaxError('"%s" template tag expects at most 2 non-keyword arguments when embedding instances.')
- ct = get_content_type(bits[0])
+ ct = parse_content_type(bits[0], tag)
pk = bits[1]
try: