| author | wakimd |
| Fri, 22 Oct 2010 18:14:30 +0200 | |
| changeset 1 | eb9188f2ee4f |
| permissions | -rw-r--r-- |
| 1 | 1 |
from django.db import models |
2 |
from django.contrib.auth.models import * |
|
3 |
||
4 |
||
5 |
class Owner(models.Model): |
|
6 |
user = models.ForeignKey(User, blank=True, null=True) |
|
7 |
group = models.ForeignKey(Group, blank=True, null=True) |
|
8 |
||
9 |
def __unicode__(self): |
|
10 |
if self.user: |
|
11 |
return self.user.username |
|
12 |
else: |
|
13 |
return self.group.name |
|
14 |
||
15 |
||
16 |
class Document(models.Model): |
|
17 |
owner= models.ForeignKey(Owner, blank = True, null=True) |
|
18 |
||
19 |
class Meta: |
|
20 |
abstract = True |
|
21 |
||
22 |