Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
17 additions
and
1 deletion.
There are no files selected for viewing
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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,) |