3 |
3 |
4 @author: tc |
4 @author: tc |
5 ''' |
5 ''' |
6 from django.conf import settings |
6 from django.conf import settings |
7 from django.db import models |
7 from django.db import models |
8 from hdabo.models import User |
|
9 from easy_thumbnails.fields import ThumbnailerImageField |
8 from easy_thumbnails.fields import ThumbnailerImageField |
10 |
9 |
|
10 auth_user_model = getattr(settings, 'AUTH_USER_MODEL', 'auth.User') |
11 |
11 |
12 class Renkan(models.Model): |
12 class Renkan(models.Model): |
13 |
13 |
14 owner = models.ForeignKey(User, blank=True, null=True) |
14 owner = models.ForeignKey(auth_user_model, blank=True, null=True) |
15 rk_id = models.CharField(max_length=1024, unique=True, blank=False, null=False) # typically UUID |
15 rk_id = models.CharField(max_length=1024, unique=True, blank=False, null=False) # typically UUID |
16 content = models.TextField(blank=True, null=True) |
16 content = models.TextField(blank=True, null=True) |
17 title = models.CharField(max_length=1024, null=True) |
17 title = models.CharField(max_length=1024, null=True) |
18 image = ThumbnailerImageField(upload_to="thumbnails/renkan/", default=settings.DEFAULT_RENKAN_ICON) |
18 image = ThumbnailerImageField(upload_to="thumbnails/renkan/", default=settings.DEFAULT_RENKAN_ICON) |
19 creation_date = models.DateTimeField(auto_now_add=True) |
19 creation_date = models.DateTimeField(auto_now_add=True) |