Added contentlet unicode and fixed container context bug.
authormelinath <stephen.r.burrows@gmail.com>
Wed, 16 Jun 2010 15:19:40 +0000 (11:19 -0400)
committermelinath <stephen.r.burrows@gmail.com>
Wed, 16 Jun 2010 15:19:40 +0000 (11:19 -0400)
admin.py
models.py
templatetags/containers.py

index 1566c5b..5737041 100644 (file)
--- a/admin.py
+++ b/admin.py
@@ -41,6 +41,7 @@ class CollectionMemberInline(admin.TabularInline):
        extra = 1
        classes = ('collapse-closed',)
        allow_add = True
+       fields = ('member_content_type', 'member_object_id', 'index',)
 
 
 class CollectionAdmin(admin.ModelAdmin):
index 9210e1b..88863b2 100644 (file)
--- a/models.py
+++ b/models.py
@@ -389,6 +389,9 @@ class Contentlet(models.Model):
        name = models.CharField(max_length=255)
        content = models.TextField()
        dynamic = models.BooleanField(default=False)
+       
+       def __unicode__(self):
+               return self.name
 
 
 class ContentReference(models.Model):
@@ -397,6 +400,9 @@ class ContentReference(models.Model):
        content_type = models.ForeignKey(ContentType, verbose_name='Content type')
        content_id = models.PositiveIntegerField(verbose_name='Content ID')
        content = generic.GenericForeignKey('content_type', 'content_id')
+       
+       def __unicode__(self):
+               return self.name
 
 
 register_templatetags('philo.templatetags.containers')
index 2e40e53..90debf6 100644 (file)
@@ -31,8 +31,7 @@ class ContainerNode(template.Node):
                if 'page' in context:
                        container_content = self.get_container_content(context)
                
-               if self.nodelist_main is None:
-                       self.nodelist_main
+               if not self.nodelist_main:
                        if container_content and self.as_var:
                                context[self.as_var] = container_content
                                return ''