Skip to content

Commit

Permalink
Moved markdown stuff into core
Browse files Browse the repository at this point in the history
  • Loading branch information
lethain committed Dec 4, 2008
1 parent bda9d18 commit ac310a1
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 1 deletion.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
18 changes: 17 additions & 1 deletion lifeflow_core/models.py
@@ -1,3 +1,19 @@
from django.db import models

# Create your models here.
class Resource(models.Model):
"""
A wrapper for files (image or otherwise, the model is unaware of the
distinction) that are used in blog entries.
"""
title = models.CharField(max_length=50)
markdown_id = models.CharField(max_length=50)
content = models.FileField(upload_to="lifeflow/resource")


def get_relative_url(self):
# figure out why I named this relative instead of absolute
# because... it sure as hell isn't relative
return u"/media/%s" % self.content

def __unicode__(self):
return u"[%s] %s" % (self.markdown_id, self.title,)

0 comments on commit ac310a1

Please sign in to comment.