Example #1
0
 def test_now(self):
     t1 = now()
     sleep(0.001)
     t2 = now()
     self.assertEqual(t1, t2)
     set_now()
     t2 = now()
     self.assertFalse(t1 == t2)
Example #2
0
 def get_query_set(self):
     dt = now()
     return super(DocumentNowManager, self).get_query_set().filter(
         document_start__lte=dt, document_end__gt=dt)
Example #3
0
 def bulk_delete_now(cls, documents):
     return cls.bulk_documents_delete(documents, now())
Example #4
0
 def bulk_save_now(cls, documents):
     cls.bulk_documents_save(documents, now())
Example #5
0
 def restore_now(self):
     self.document_restore(now())
Example #6
0
 def get_query_set(self):
     dt = now()
     tm = self.model.to_master()
     d = { tm + '__document_start__lte': dt,
           tm + '__document_end__gt': dt}
     return super(DocumentPartNowManager, self).get_query_set().filter(**d)
Example #7
0
 def delete_now(self):
     return self.document_delete(now())
Example #8
0
 def save_now(self):
     self.document_save(now())
Example #9
0
 def bulk_save_now(cls, documents):
     cls.bulk_documents_save(documents, now())
Example #10
0
 def bulk_delete_now(cls, documents):
     return cls.bulk_documents_delete(documents, now())
Example #11
0
 def get_query_set(self):
     dt = now()
     return super(DocumentNowManager,
                  self).get_query_set().filter(document_start__lte=dt,
                                               document_end__gt=dt)
Example #12
0
 def restore_now(self):
     self.document_restore(now())
Example #13
0
 def get_query_set(self):
     dt = now()
     tm = self.model.to_master()
     d = {tm + '__document_start__lte': dt, tm + '__document_end__gt': dt}
     return super(DocumentPartNowManager, self).get_query_set().filter(**d)
Example #14
0
 def delete_now(self):
     return self.document_delete(now())
Example #15
0
 def save_now(self):
     self.document_save(now())