Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. Interfaces.objects.all()
  2. .annotate(
  3. age = (datetime.utcnow() - F('timestamp')), # 0:00:08.535704
  4. age2 = Epoch(datetime.utcnow() - F('timestamp')), # 8.535704
  5. # age3 = int(Epoch(datetime.utcnow() - F('timestamp'))/300),
  6. current_time=Value(str(datetime.utcnow()),
  7. output_field=null_char_field),
  8. )
  9. .order_by('age','ip')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement