| author | ymh <ymh.work@gmail.com> |
| Fri, 06 May 2011 01:01:51 +0200 | |
| changeset 95 | 8e57d39f660d |
| parent 63 | 93325a5d61f0 |
| child 125 | 5c3ed9c919bb |
| permissions | -rw-r--r-- |
| 63 | 1 |
from django.contrib.auth.models import User, Group |
| 0 | 2 |
from django.db import models |
3 |
||
4 |
||
5 |
class Owner(models.Model): |
|
|
13
97ab7b3191cf
add api to update project, uses psiton
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
6 |
user = models.ForeignKey(User, blank=True, null=True) |
|
97ab7b3191cf
add api to update project, uses psiton
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
7 |
group = models.ForeignKey(Group, blank=True, null=True) |
| 0 | 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): |
|
|
13
97ab7b3191cf
add api to update project, uses psiton
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
17 |
owner = models.ForeignKey(Owner, blank=True, null=True) |
| 0 | 18 |
|
19 |
class Meta: |
|
20 |
abstract = True |
|
21 |
||
22 |