from django.db import models
from darkoob.social.models import User

# Create your models here.
class Group(models.Model):
    name = models.CharField(max_length=255)
    admin = models.ForeignKey(User)
    members = models.ManyToManyField(User)

    def __unicode__(self):
        return self.name


@@ -60,16 +60,53 @@
 ort User
+%0Afrom darkoob.book.models import Book
 %0A%0A# Crea
@@ -231,16 +231,42 @@
 Key(User
+, related_name='admin_set'
 )%0A    me
@@ -300,16 +300,42 @@
 eld(User
+, related_name='group_set'
 )%0A%0A    d
@@ -382,8 +382,614 @@
 f.name%0A%0A
+class Schedule(models.Model):%0A    group = models.ForeignKey(Group)%0A    book = models.ForeignKey(Book)%0A%0A    def __unicode__(self):%0A        return %22%25s - %25s%22 %25 (self.group.name, self.book.title)%0A%0Aclass Deadline(models.Model):%0A    schedule = models.ForeignKey(Schedule)%0A    from_page = models.PositiveIntegerField()%0A    to_page = models.PositiveIntegerField()%0A    end_time = models.DateField()%0A%0A    def __unicode__(self):%0A        return %22%25s, %25s from page %25g to %25g%22 %25 (%0A            self.schedule.group.name,%0A            self.schedule.book.title,%0A            self.from_page,%0A            self.to_page,%0A        )%0A%0A

Update group models