Commits

Simone Gasbarroni committed 1218125

removed some junk from code

Comments (0)

Files changed (1)

turbopress/model/ming/models.py

 
 class ArticleExt(MapperExtension):
     def before_update(self, instance, state, sess):
-        print 'update?'
-        self._change_status(instance)
+        instance.update_date = datetime.utcnow()
 
-    def _change_status(self, instance):
-        instance.update_date = datetime.utcnow()
 
 class Article(MappedClass):
     class __mongometa__:
         indexes = [('title',), ('published',), ('blog_id',), ('publish_date',)]
         extensions = [ArticleExt]
 
-
     _id = FieldProperty(s.ObjectId)
     title = FieldProperty(s.String, if_missing=u"Untitled")
     published = FieldProperty(s.Bool, if_missing=False)
         return str(self._id)
 
     @staticmethod
-    def before_delete(mapper, connection, obj):
-        pass  # TODO: Tagging
-
-    @staticmethod
     def get_published(blog=None):
         now = datetime.now()
         filter = {'published': True,
 
 class AttachmentExt(MapperExtension):
     def before_delete(self, instance, state, sess):
-        self.delete_file(instance)
-
-    def delete_file(self, instance):
         try:
             os.unlink(instance.content.local_path)
         except:
             pass
 
+
 class Attachment(MappedClass):
     class __mongometa__:
         name = 'turbopress_attachments'