# Path: simple_cms/models.py
# class CommonAbstractModel(models.Model):
#     """
#     Common ABC for most models.
#     Provides created/updated_at, and active/inactive status.
#     """
#     created_at = CreationDateTimeField()
#     updated_at = ModificationDateTimeField()
#     active = models.BooleanField(default=True, verbose_name="published")
#     objects = CommonAbstractManager()
# 
#     class Meta:
#         get_latest_by = 'updated_at'
#         ordering = ('-updated_at', '-created_at')
#         abstract = True
# 
#     def get_class_name(self):
#         return self.__class__.__name__


from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
from django.db import models
from positions.fields import PositionField
from simple_cms.models import CommonAbstractModel


class Language(CommonAbstractModel):
    name = models.CharField(max_length=255, unique=True)
    code = models.CharField(max_length=10, unique=True)
    display_name = models.CharField(max_length=255, blank=True, default='')
    order = PositionField()
    
    class Meta:
        ordering = ['order']
    
    @property
    def title(self):
        if self.display_name:
            return self.display_name
        return self.name

    def __unicode__(self):
        return u'%s' % self.name


# Path: simple_cms/models.py
# class CommonAbstractModel(models.Model):
#     """
#     Common ABC for most models.
#     Provides created/updated_at, and active/inactive status.
#     """
#     created_at = CreationDateTimeField()
#     updated_at = ModificationDateTimeField()
#     active = models.BooleanField(default=True, verbose_name="published")
#     objects = CommonAbstractManager()
# 
#     class Meta:
#         get_latest_by = 'updated_at'
#         ordering = ('-updated_at', '-created_at')
#         abstract = True
# 
#     def get_class_name(self):
#         return self.__class__.__name__


# Path: simple_cms/contrib/translated_model/models.py
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
from django.db import models
from positions.fields import PositionField
from simple_cms.models import CommonAbstractModel



class Language(CommonAbstractModel):
    name = models.CharField(max_length=255, unique=True)
    code = models.CharField(max_length=10, unique=True)
    display_name = models.CharField(max_length=255, blank=True, default='')
    order = PositionField()
    
    class Meta:
        ordering = ['order']
    
    @property
    def title(self):
        if self.display_name:
            return self.display_name
        return self.name

    def __unicode__(self):
        return u'%s' % self.name


class Translation(CommonAbstractModel):