class Foo(models.Model):
user = models.ForeignKey(MyUser)
action_datetime = models.DateTimeField(auto_now_add=True)
from datetime import datetime, timedelta
def form_view(request):
if Foo.objects.get(
user=request.user,
action_datetime__gt=datetime.now() - timedelta(days=1)):
# do what u want
сейчас - день назад = вчера = datetime.now() - timedelta(days=1)