This file contains hidden or 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.db import models | |
class S3PrivateFileField(models.FileField): | |
""" | |
Using this for local storage is also viable since it's only an | |
instance attribute, which is not used in local storage. | |
""" | |
def __init__(self, verbose_name=None, name=None, upload_to='', | |
storage=None, **kwargs): |
This file contains hidden or 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
import logging | |
import os | |
from django.db import models | |
from django.utils import timezone | |
from autoslug import AutoSlugField | |
from ckeditor.fields import RichTextField | |
from positions.fields import PositionField | |
from slugify import slugify |
This file contains hidden or 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 rest_framework import serializers | |
from .models import ClonedTopic, Topic, Note, ExternalDocument | |
# The reason Create and List is separated is that, | |
# if we specify depth, then somehow some of the fields are disabled/not, | |
# available when we do a POST, so we can't essentialy create an object! | |
# This issue is reproduceable you can test it for yourself, | |
# but as for the reason why, I am not investigate it yet. | |
# A separate serializer without depth is needed for CreateView. |