server/python/django/renkanmanager/models.py
author rougeronj
Wed, 16 Sep 2015 17:36:46 +0200
changeset 524 904effa4b6d7
parent 387 87555646dd07
permissions -rw-r--r--
improve view management: - we can pass a negative view index, in this case we count from the end of the list of view - before creating/changing the view representation, we remove the previous one and reinitialize the node visibility - each time we save a view, it creates a new one at the end of the list - "restore" view loads the last view of the list

'''
Created on Jul 17, 2014

@author: tc
'''
from django.conf import settings
from django.db import models
from easy_thumbnails.fields import ThumbnailerImageField

auth_user_model = getattr(settings, 'AUTH_USER_MODEL', 'auth.User')

class Renkan(models.Model):
    
    owner = models.ForeignKey(auth_user_model, blank=True, null=True)
    rk_id = models.CharField(max_length=1024, unique=True, blank=False, null=False) # typically UUID
    content = models.TextField(blank=True, null=True)
    title = models.CharField(max_length=1024, null=True)
    image = ThumbnailerImageField(upload_to="thumbnails/renkan/", default=settings.DEFAULT_RENKAN_ICON)
    creation_date = models.DateTimeField(auto_now_add=True)
    modification_date = models.DateTimeField(auto_now=True)
    
    class Meta:
        app_label = 'renkanmanager'