1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-14 06:11:16 +00:00

Add contact and share app

This commit is contained in:
plt
2012-02-11 11:12:54 +08:00
parent fe1b85dbd6
commit 67e0ce2fb6
24 changed files with 406 additions and 39 deletions

19
share/models.py Normal file
View File

@@ -0,0 +1,19 @@
from django.db import models
from django.contrib.auth.models import User
class UserShare(models.Model):
"""Record a repo shared to a user."""
from_user = models.ForeignKey(User, related_name="myshare_items")
to_user = models.ForeignKey(User, related_name="share2me_items")
repo_id = models.CharField(max_length=36)
class GroupShare(models.Model):
"""A repo shared to a group."""
group_id = models.CharField(max_length=36)
repo_id = models.CharField(max_length=36)
class Meta:
unique_together = ("group_id", "repo_id")