]> git.parisson.com Git - teleforma.git/commitdiff
remove Notes, fix Conference.description
authorGuillaume Pellerin <yomguy@parisson.com>
Wed, 24 Jun 2015 10:52:22 +0000 (12:52 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Wed, 24 Jun 2015 10:52:22 +0000 (12:52 +0200)
example/settings.py
teleforma/models/core.py

index 8b0084fcc9fabd48b54353c60e9d96e25c4ae788..5d0ed15868fb6c2ca2e86afeec4cbfadd798f898 100644 (file)
@@ -217,4 +217,4 @@ SOUTH_MIGRATION_MODULES = {
 
 SUIT_CONFIG = {
     'ADMIN_NAME': 'TeleForma Admin',
-}
\ No newline at end of file
+}
index a99b7c72bfcc3846c5e35f8e30f6ce342f27858b..80083c08a48896a070e9d69a800e95c695396275 100644 (file)
@@ -51,7 +51,6 @@ from django.utils.translation import ugettext_lazy as _
 from django.contrib.auth.models import User
 from django.core.exceptions import ValidationError
 from django.contrib.contenttypes import generic
-from notes.models import Note
 import jqchat.models
 from django.core.paginator import InvalidPage, EmptyPage
 from django.template.defaultfilters import slugify
@@ -163,8 +162,6 @@ class Course(Model):
     obligation      = BooleanField(_('obligations'))
     magistral       = BooleanField(_('magistral'))
 
-    notes = generic.GenericRelation(Note)
-
     def __unicode__(self):
         return self.title
 
@@ -210,7 +207,7 @@ class Professor(Model):
     department = ForeignKey('Department', related_name='professor',
                                  verbose_name=_('department'),
                                  blank=True, null=True, on_delete=models.SET_NULL)
-    
+
     def __unicode__(self):
         if self.user.first_name and self.user.last_name:
             return self.user.last_name + ' ' + self.user.first_name[0] + '.'
@@ -268,10 +265,18 @@ class Conference(Model):
                                         blank=True, null=True)
     status          = models.IntegerField(_('status'), choices=STATUS_CHOICES, default=2)
 
-    notes = generic.GenericRelation(Note)
-
     @property
     def description(self):
+        return self.__unicode__()
+
+    @property
+    def slug(self):
+        slug = '-'.join([self.course.department.slug,
+                         self.course.slug,
+                         self.course_type.name.lower()])
+        return slug
+
+    def __unicode__(self):
         if self.professor:
             list = [self.course.department.name, self.course.title,
                            self.course_type.name, self.session,
@@ -284,16 +289,6 @@ class Conference(Model):
                            str(self.date_begin)]
         return ' - '.join(list)
 
-    @property
-    def slug(self):
-        slug = '-'.join([self.course.department.slug,
-                         self.course.slug,
-                         self.course_type.name.lower()])
-        return slug
-
-    def __unicode__(self):
-        return self.description
-
     def save(self, *args, **kwargs):
         if not self.public_id:
             self.public_id = get_random_hash()
@@ -465,7 +460,6 @@ class MediaBase(Model):
     is_published    = BooleanField(_('published'))
     mime_type       = CharField(_('mime type'), max_length=255, blank=True)
     weight          = models.IntegerField(_('weight'), choices=WEIGHT_CHOICES, default=1, blank=True)
-    notes = generic.GenericRelation(Note)
 
     def get_fields(self):
         return self._meta.fields