aboutsummaryrefslogtreecommitdiffstats
path: root/97suifangqa/apps/sciblog/models.py
diff options
context:
space:
mode:
authorAlvin Li <liweitianux@gmail.com>2013-09-20 23:52:59 +0800
committerAlvin Li <liweitianux@gmail.com>2013-09-20 23:52:59 +0800
commitc9da4168874296cf4f5ba71b9a432ceae3c26130 (patch)
tree0c986d630c9634b8dbbbbe694546b42c7bb74210 /97suifangqa/apps/sciblog/models.py
parent62efe8809e2cdfc84666dbd5e987a4ce473a047a (diff)
download97dev-c9da4168874296cf4f5ba71b9a432ceae3c26130.tar.bz2
*** merged changes of front pages ***
* merged changes from '97suifang-front' by mjymjydark; and modified to work with django * finished 'editing_data' div of 'SheetDefault' for add new record * added 'indicator.views.ajax_add_record()' *** search *** * improved 'search' function of 'NewDeleteIndex' page; employ AJAX to load search results; * added 'indicator.views.search_indicators()' *** recommend indicator *** * improved the functions of 'recommend_indicator' * added 'sciblog.models.UserCollection' to record the collection information for each user * improved 'sciblog.views.add_user_to_m2m()' to work with 'UserCollection' * added field 'lastRecommendTime' in 'indicator.models.UserIndicator' * updated 'indicator.views.indicator_status' against 'recommend_indicator' *** qtip2 for recommended indicator *** * added 'qtip2' tooltip for recommended indicator card * added '97suifang' qtip css (qtip-sf) * added tooltip for 'add record' when return error (SheetDefault page); * improved the style of 'collection_btn' and 'go_library_btn' of IndexDesc page;
Diffstat (limited to '97suifangqa/apps/sciblog/models.py')
-rw-r--r--97suifangqa/apps/sciblog/models.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/97suifangqa/apps/sciblog/models.py b/97suifangqa/apps/sciblog/models.py
index d6a63d4..8c8d0cf 100644
--- a/97suifangqa/apps/sciblog/models.py
+++ b/97suifangqa/apps/sciblog/models.py
@@ -330,6 +330,43 @@ class BaseLine(models.Model):
# }}}
+# UserCollection {{{
+class UserCollection(models.Model):
+ """
+ record the collections/catches for user
+ 记录用户收藏的"注释"/"文章",以及标注看懂了的文章
+ """
+ user = models.OneToOneField(User, verbose_name=u"用户",
+ related_name="user_collection")
+ # collect annotation
+ # -> BlogAnnotation.collected_by
+ #collectedAnnotation = models.ManyToManyField("BlogAnnotation",
+ # verbose_name=u"收藏的注释",
+ # related_name="collected_annotations",)
+ lastCollectAnnotationTime = models.DateTimeField(u"上次收藏注释时间",
+ null=True, blank=True)
+ # catch blog
+ # -> SciBlog.catched_by
+ #catchedBlog = models.ManyToManyField("SciBlog",
+ # verbose_name=u"收藏的文章",
+ # related_name="catched_blogs",)
+ lastCatchBlogTime = models.DateTimeField(u"上次读懂文章时间",
+ null=True, blank=True)
+ # collect blog
+ # -> SciBlog.collected_by
+ #collectedBlog = models.ManyToManyField("SciBlog",
+ # verbose_name=u"收藏的文章",
+ # related_name="collected_blogs",)
+ lastCollectBlogTime = models.DateTimeField(u"上次收藏文章时间",
+ null=True, blank=True)
+
+ class Meta:
+ verbose_name_plural = u"用户收藏信息"
+
+ def __unicode__(self):
+ return "< UserCollection: for %s >" % self.user.username
+# UserCollection }}}
+
admin.site.register([
Source,
@@ -340,4 +377,5 @@ admin.site.register([
BaseLine,
ResultContent,
BlogAnnotation,
+ UserCollection,
])