TianyiMoe/backend/randpic/random_picture.py

8 lines
148 B
Python
Raw Normal View History

2024-04-27 07:50:22 +00:00
import json
import random
2024-04-30 01:05:28 +00:00
from .models import Picture
pics=Picture.objects.order_by("?")
2024-04-27 07:50:22 +00:00
def get_random_picture():
2024-04-30 01:41:56 +00:00
return pics[0].name+".webp"