1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-06-29 08:27:55 +00:00
seahub/share/models.py

20 lines
564 B
Python
Raw Normal View History

2012-02-11 03:12:54 +00:00
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")