src/ldt/ldt/core/models.py
author ymh <ymh.work@gmail.com>
Fri, 11 Feb 2011 13:31:26 +0100
changeset 24 57a2650a7f87
parent 13 97ab7b3191cf
child 63 93325a5d61f0
permissions -rw-r--r--
update nyromodal introduce media mimetype change metadataplayer mode ans siz according to media mimetype

from django.db import models
from django.contrib.auth.models import *


class Owner(models.Model):
    user = models.ForeignKey(User, blank=True, null=True)
    group = models.ForeignKey(Group, blank=True, null=True)

    def __unicode__(self):
        if self.user:
            return self.user.username
        else:
            return self.group.name


class Document(models.Model):
    owner = models.ForeignKey(Owner, blank=True, null=True)

    class Meta:
        abstract = True