summaryrefslogtreecommitdiffstats
path: root/feincms/content/file/models.py
diff options
context:
space:
mode:
authorsubstantialnoninfringinguser <substantialnoninfringinguser@gmail.com>2009-05-21 19:47:19 +0100
committersubstantialnoninfringinguser <substantialnoninfringinguser@gmail.com>2009-05-21 19:47:19 +0100
commit54a62999c03f5293b42d56f9a99b1c5a3b02fa5f (patch)
tree8221aee4d3e16f1373c3162cd7c44eebb273345a /feincms/content/file/models.py
parent99949d466a0bf2667bad10f8c6c2c751036fd858 (diff)
downloadtroggle-54a62999c03f5293b42d56f9a99b1c5a3b02fa5f.tar.gz
troggle-54a62999c03f5293b42d56f9a99b1c5a3b02fa5f.tar.bz2
troggle-54a62999c03f5293b42d56f9a99b1c5a3b02fa5f.zip
[svn] Updates to allow subcave tree with nice admin.
Diffstat (limited to 'feincms/content/file/models.py')
-rw-r--r--feincms/content/file/models.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/feincms/content/file/models.py b/feincms/content/file/models.py
new file mode 100644
index 0000000..4ad4f20
--- /dev/null
+++ b/feincms/content/file/models.py
@@ -0,0 +1,20 @@
+from django.db import models
+from django.template.loader import render_to_string
+from django.utils.translation import ugettext_lazy as _
+
+
+class FileContent(models.Model):
+ title = models.CharField(max_length=200)
+ file = models.FileField(_('file'), upload_to='filecontent')
+
+ class Meta:
+ abstract = True
+ verbose_name = _('file')
+ verbose_name_plural = _('files')
+
+ def render(self, **kwargs):
+ return render_to_string([
+ 'content/file/%s.html' % self.region.key,
+ 'content/file/default.html',
+ ], {'content': self})
+