diff options
-rw-r--r-- | INSTALL | 15 | ||||
-rw-r--r-- | forum/models.py | 22 |
2 files changed, 35 insertions, 2 deletions
@@ -8,7 +8,8 @@ B. INSTALLATION 4. Installation under Apache/WSGI 5. Full text search 6. Email subscriptions - 7. Miscellaneous + 7. Sitemap + 8. Miscellaneous C. CONFIGURATION PARAMETERS (settings_local.py) D. CUSTOMIZATION @@ -212,7 +213,17 @@ WSGIPythonEggs /var/python/eggs #must be readable and writable by apache subscription sender may be tested manually in shell by calling cron/send_email_alerts -7. Miscellaneous +7. Sitemap +Sitemap will be available at /<settings_local.FORUM_SCRIPT_ALIAS>sitemap.xml +e.g yoursite.com/forum/sitemap.xml + +google will be pinged each time question, answer or +comment is saved or a question deleted + +for this to be useful - do register you sitemap with Google at +https://www.google.com/webmasters/tools/ + +8. Miscellaneous There are some demo scripts under sql_scripts folder, including badges and test accounts for CNProg.com. You diff --git a/forum/models.py b/forum/models.py index eb3650f8..bceced1a 100644 --- a/forum/models.py +++ b/forum/models.py @@ -102,6 +102,14 @@ class Comment(models.Model): class Meta: ordering = ('-added_at',) db_table = u'comment' + + def save(self,**kwargs): + super(Comment,self).save(**kwargs) + try: + ping_google() + except Exception: + logging.debug('problem pinging google did you register you sitemap with google?') + def __unicode__(self): return self.comment @@ -199,6 +207,13 @@ class Question(models.Model): objects = QuestionManager() + def delete(self): + super(Question, self).delete() + try: + ping_google() + except Exception: + logging.debug('problem pinging google did you register you sitemap with google?') + def save(self, **kwargs): """ Overridden to manually manage addition of tags when the object @@ -458,6 +473,13 @@ class Answer(models.Model): get_comments = get_object_comments get_last_update_info = post_get_last_update_info + def save(self,**kwargs): + super(Answer,self).save(**kwargs) + try: + ping_google() + except Exception: + logging.debug('problem pinging google did you register you sitemap with google?') + def get_user_vote(self, user): votes = self.votes.filter(user=user) if votes.count() > 0: |