class Meta:
abstract = True
-
+
class Collection(models.Model):
name = models.CharField(max_length=255)
description = models.TextField(blank=True, null=True)
+ @fattr(short_description='Members')
def get_count(self):
return self.members.count()
- get_count.short_description = 'Members'
def __unicode__(self):
return self.name
+
class CollectionMemberManager(models.Manager):
use_for_related_fields = True
member = generic.GenericForeignKey('member_content_type', 'member_object_id')
def __unicode__(self):
- return '%s - %s' % (self.collection, self.member)
+ return u'%s - %s' % (self.collection, self.member)
class TreeManager(models.Manager):
return HttpResponseServerError()
class Meta:
- unique_together=(('parent', 'slug',),)
+ unique_together = (('parent', 'slug'),)
class MultiNode(Node):
class Template(TreeModel):
name = models.CharField(max_length=255)
documentation = models.TextField(null=True, blank=True)
- mimetype = models.CharField(max_length=255, null=True, blank=True, help_text='Default: %s' % settings.DEFAULT_CONTENT_TYPE, default=settings.DEFAULT_CONTENT_TYPE)
+ mimetype = models.CharField(max_length=255, null=True, blank=True, help_text='Default: %s' % settings.DEFAULT_CONTENT_TYPE)
code = models.TextField(verbose_name='django template code')
@property
name = models.CharField(max_length=255)
content = models.TextField()
dynamic = models.BooleanField(default=False)
+
+ def __unicode__(self):
+ return self.name
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')