Created
June 30, 2015 01:14
-
-
Save luzfcb/226612d0b98dd4493f9d 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
# basically is this: | |
from django.db import models | |
from django.utils import timezone | |
from django.conf import settings | |
USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', 'auth.User') | |
class Document(models.Model): | |
content = models.TextField(blank=True) | |
created_at = models.DateTimeField(default=timezone.now, blank=True, editable=False) | |
created_by = models.ForeignKey(to=USER_MODEL, | |
related_name="%(app_label)s_%(class)s_created_by", null=True, | |
blank=True, on_delete=models.SET_NULL) | |
modified_at = models.DateField(auto_now=True, blank=True, editable=False) | |
modified_by = models.ForeignKey(to=USER_MODEL, | |
related_name="%(app_label)s_%(class)s_modified_by", null=True, | |
blank=True, on_delete=models.SET_NULL) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment