Created
August 15, 2012 08:06
-
-
Save spenoir/3357540 to your computer and use it in GitHub Desktop.
just a Content model example
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
class ContentImage(models.Model): | |
""" | |
An Image that is specific to Content | |
""" | |
content = models.ForeignKey('ContentModel', related_name='images') | |
# credit = models.CharField(max_length=200, blank=True) | |
# caption = models.TextField(blank=True) | |
image = models.ImageField(upload_to=settings.UPLOAD_PATH_CONTENTS_MEDIA) | |
position = models.CharField(max_length=8, choices=CONTENTS_MEDIA_POSITIONS, blank=True, null=True) | |
class ContentModel(SuperModel): | |
title = models.CharField(max_length=255) | |
slug = models.SlugField() | |
intro = models.TextField(blank=True, null=True) | |
intro_image = models.ImageField(upload_to=settings.UPLOAD_PATH_CONTENTS_MEDIA, blank=True, null=True) | |
content = models.TextField(blank=True, null=True) | |
video = models.CharField(max_length=255, blank=True, null=True) | |
video_position = models.CharField(max_length=8, choices=CONTENTS_MEDIA_POSITIONS, blank=True, null=True) | |
date_published = models.DateTimeField() | |
class Meta: | |
abstract = True | |
.... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment