def test_now(self): t1 = now() sleep(0.001) t2 = now() self.assertEqual(t1, t2) set_now() t2 = now() self.assertFalse(t1 == t2)
def get_query_set(self): dt = now() return super(DocumentNowManager, self).get_query_set().filter( document_start__lte=dt, document_end__gt=dt)
def bulk_delete_now(cls, documents): return cls.bulk_documents_delete(documents, now())
def bulk_save_now(cls, documents): cls.bulk_documents_save(documents, now())
def restore_now(self): self.document_restore(now())
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)
def delete_now(self): return self.document_delete(now())
def save_now(self): self.document_save(now())
def get_query_set(self): dt = now() return super(DocumentNowManager, self).get_query_set().filter(document_start__lte=dt, document_end__gt=dt)
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)