Last active
February 9, 2018 06:01
-
-
Save Nipun2016/62f49627b41580c59f475e47e1a269d2 to your computer and use it in GitHub Desktop.
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
from django.contrib.contenttypes.models import ContentType | |
from django.contrib.contenttypes.fields import GenericForeignKey | |
class FileAttachment(models.Model): | |
content_type = models.ForeignKey(ContentType, related_name="content_type_timelines") | |
object_id = models.PositiveIntegerField() | |
content_object = GenericForeignKey('content_type', 'object_id') | |
created = models.DateTimeField(_('created'), auto_now_add=True) | |
modified = models.DateTimeField(_('modified'), auto_now=True) | |
attachment_file = models.FileField(_('attachment'), upload_to=attachment_upload) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment